[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Health-dev] HMIS client config folder
From: |
Luis Falcon |
Subject: |
Re: [Health-dev] HMIS client config folder |
Date: |
Wed, 1 Feb 2023 12:39:48 +0000 |
Hi, Gerald!
On Wed, 1 Feb 2023 13:18:58 +0100
Gerald Wiese <wiese@gnuhealth.org> wrote:
> Hello,
>
> I just tested the GNU Health client release candidate using TestPyPI.
> As I am filling the config files with Ansible I was missing the
> expected profiles.
>
> Usually the config folders were named '3.8' and '4.0' so I would have
> expected '4.2' but just got '4'.
>
> Seems like the code expects 3 numbers separated by dots and does not
> exclude 'rc' or 'b' for beta or release candidate versions.
True :) GH Client is only accepting number-based versions for its
profile.
>
> I Managed to get config folder '4.2' like this:
>
> --- a/gnuhealth/config.py Wed Jan 25 19:31:19 2023 +0000
> +++ b/gnuhealth/config.py Wed Feb 01 13:09:09 2023 +0100
> @@ -34,9 +34,9 @@
> if not isinstance(appdata, str):
> appdata = str(appdata, sys.getfilesystemencoding())
> return os.path.join(appdata, '.config', 'gnuhealth',
> - __version__.rsplit('.', 1)[0])
> + '.'.join(__version__.split('.',
> 2)[:2]).split('rc')[0].split('b')[0])
> return os.path.join(os.environ['HOME'], '.config', 'gnuhealth',
> - __version__.rsplit('.', 1)[0])
> + '.'.join(__version__.split('.',
> 2)[:2]).split('rc')[0].split('b')[0])
>
>
> Before it just removed the last element separated by '.'
>
> I took the approach from the same file to define 'short_version' to
> rather take the first two elements separated by dots and then added
> to cut anything starting with 'rc' or 'b'.
>
> Not sure if this would have ever been relevant outside the release
> candidate version but could be a small improvement.
>
I think is great to be able to have the possibility to install the RC /
pre-releases versions too, so I favor to apply your patch on this GH
client 4.1.x series.
All the best,
Luis
> Best
>
> Gerald
>
>