decorare-oglive-methodsexec-ogbrowserfix-urlfixes-winlgromero-filebeatlog-sess-lenmainmodulesnew-browserno-ptt-paramogadmcliogadmclient-statusogcore1oggitoglogoglog2override-moduleping1ping2ping3ping4report-progresssched-tasktlsunification2unification3versions
Last change
on this file since 5f7ca5b was
10fab78,
checked in by Natalia Serrano <natalia.serrano@…>, 11 months ago
|
refs #464 several fixes and improvements
- fix OG icon in windows system tray
- change a log.info into log.debug to avoid a crash (!)
- migrate update.sh to python so it can be run from windows/macos too
- manage windows/VERSION in this script too
- remove call to pyrcc--it's not required!
- remove stray windows scripts
- add a forgotten setup.bat
|
-
Property mode set to
100755
|
File size:
1.2 KB
|
Rev | Line | |
---|
[10fab78] | 1 | #!/usr/bin/python3 |
---|
| 2 | |
---|
| 3 | import os |
---|
| 4 | import re |
---|
| 5 | import sys |
---|
| 6 | import subprocess |
---|
| 7 | import fileinput |
---|
| 8 | |
---|
| 9 | def update_version(): |
---|
| 10 | if os.path.isfile ('VERSION'): |
---|
| 11 | with open ('VERSION', 'r') as version_file: |
---|
| 12 | version = version_file.read().strip() |
---|
| 13 | |
---|
| 14 | pattern = r'[0-9]*\.[0-9]*\.[0-9]*' |
---|
| 15 | matches = re.findall (pattern, version) |
---|
| 16 | win_version = matches[0] |
---|
| 17 | |
---|
| 18 | with fileinput.FileInput ('about-dialog.ui', inplace=True) as file: |
---|
| 19 | for line in file: |
---|
| 20 | print (line.replace ('Version [^<]*', f'Version {version}'), end='') |
---|
| 21 | |
---|
| 22 | with fileinput.FileInput ('opengnsys/__init__.py', inplace=True) as file: |
---|
| 23 | for line in file: |
---|
| 24 | print(line.replace ('VERSION=.*', f"VERSION='{version}'"), end='') |
---|
| 25 | |
---|
| 26 | with open ('../windows/VERSION', 'w') as outfile: |
---|
| 27 | outfile.write (win_version + '\n') |
---|
| 28 | |
---|
| 29 | else: |
---|
| 30 | print ('VERSION: No such file or directory') |
---|
| 31 | sys.exit (1) |
---|
| 32 | |
---|
| 33 | def process_ui(): |
---|
| 34 | subprocess.run (['pyuic6', 'about-dialog.ui', '-o', 'about_dialog_ui.py', '-x']) |
---|
| 35 | subprocess.run (['pyuic6', 'message-dialog.ui', '-o', 'message_dialog_ui.py', '-x']) |
---|
| 36 | |
---|
| 37 | if __name__ == "__main__": |
---|
| 38 | os.chdir (os.path.dirname (os.path.abspath (__file__))) |
---|
| 39 | update_version() |
---|
| 40 | process_ui() |
---|
Note: See
TracBrowser
for help on using the repository browser.