From b7788d9c1df9c32a301e2e29a78d41aa53fc7132 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Fri, 2 Aug 2024 13:49:02 +0200 Subject: [PATCH] refs #538 fix updating the ogagent version across the codebase --- src/about-dialog.ui | 2 +- src/opengnsys/__init__.py | 2 +- src/update.py | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/about-dialog.ui b/src/about-dialog.ui index df40da5..93f4817 100644 --- a/src/about-dialog.ui +++ b/src/about-dialog.ui @@ -65,7 +65,7 @@ - Version 1.3.0 + Version 0 diff --git a/src/opengnsys/__init__.py b/src/opengnsys/__init__.py index e268ca7..cf7a335 100644 --- a/src/opengnsys/__init__.py +++ b/src/opengnsys/__init__.py @@ -37,7 +37,7 @@ import six from . import modules from .RESTApi import REST, RESTError -VERSION='1.3.0' +VERSION='0' __title__ = 'OpenGnsys Agent' __version__ = VERSION diff --git a/src/update.py b/src/update.py index 11f2648..caf18f1 100755 --- a/src/update.py +++ b/src/update.py @@ -17,11 +17,13 @@ def update_version(): with fileinput.FileInput ('about-dialog.ui', inplace=True) as file: for line in file: - print (line.replace ('Version [^<]*', f'Version {version}'), end='') + new = re.sub (r'Version [^<]*', 'Version {}'.format(version), line) + print (new, end='') with fileinput.FileInput ('opengnsys/__init__.py', inplace=True) as file: for line in file: - print(line.replace ('VERSION=.*', f"VERSION='{version}'"), end='') + new = re.sub (r'VERSION=.*', "VERSION='{}'".format(version), line) + print (new, end='') with open ('../windows/VERSION', 'w') as outfile: outfile.write (win_version + '\n')