Skip to content

Commit

Permalink
<fix> fix unable to get python version due to codec problem
Browse files Browse the repository at this point in the history
update version to v2.3.5
  • Loading branch information
anonymousException committed Jun 5, 2024
1 parent 840fd37 commit 6791ea1
Show file tree
Hide file tree
Showing 30 changed files with 39 additions and 44 deletions.
25 changes: 10 additions & 15 deletions src/call_game_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,17 @@ def get_python_path(game_path):
return python_path


def get_python_version(game_path):
command = get_python_path(game_path) + ' -O --version'
f = io.open(os.getcwd() + '/tmp_python_version.txt', 'w', encoding='utf-8')
p = subprocess.Popen(command, shell=True, stdout=f, stderr=f,
creationflags=0x08000000, text=True, encoding='utf-8')
p.wait()
f.close()
f = io.open(os.getcwd() + '/tmp_python_version.txt', 'r', encoding='utf-8')
python_version = f.read()
f.close()
os.remove(os.getcwd() + '/tmp_python_version.txt')
return python_version


def is_python2(game_path):
return get_python_version(game_path).startswith('Python 2.')
python_dir = os.path.dirname(get_python_path(game_path))
paths = os.walk(python_dir, topdown=False)
is_py2 = False
for path, dir_lst, file_lst in paths:
for file_name in file_lst:
i = os.path.join(path, file_name)
if 'python2' in i or 'py2' in i:
is_py2 = True
break
return is_py2


def get_py_path(game_path):
Expand Down
Binary file modified src/qm/arabic.qm
Binary file not shown.
Binary file modified src/qm/bengali.qm
Binary file not shown.
Binary file modified src/qm/chinese.qm
Binary file not shown.
Binary file modified src/qm/french.qm
Binary file not shown.
Binary file modified src/qm/german.qm
Binary file not shown.
Binary file modified src/qm/greek.qm
Binary file not shown.
Binary file modified src/qm/hindi.qm
Binary file not shown.
Binary file modified src/qm/japanese.qm
Binary file not shown.
Binary file modified src/qm/korean.qm
Binary file not shown.
Binary file modified src/qm/portuguese.qm
Binary file not shown.
Binary file modified src/qm/russian.qm
Binary file not shown.
Binary file modified src/qm/spanish.qm
Binary file not shown.
Binary file modified src/qm/turkish.qm
Binary file not shown.
Binary file modified src/qm/urdu.qm
Binary file not shown.
4 changes: 2 additions & 2 deletions src/ts/arabic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>الإصدار2.3.4</translation>
<source>Version 2.3.5</source>
<translation>الإصدار2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/bengali.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>সংস্করণ 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>সংস্করণ 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/chinese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1193,8 +1193,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>版本 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>版本 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
2 changes: 1 addition & 1 deletion src/ts/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<source>Version 2.3.5</source>
<translation type="unfinished"></translation>
</message>
<message>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/french.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>Version 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>Version 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/german.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1303,8 +1303,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>Version 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>Version 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="391"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/greek.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1268,8 +1268,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>Έκδοση 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>Έκδοση 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="391"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/hindi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>संस्करण 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>संस्करण 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/japanese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1189,8 +1189,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>バージョン2.3.4</translation>
<source>Version 2.3.5</source>
<translation>バージョン2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/korean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1303,8 +1303,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>버전 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>버전 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="391"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/portuguese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>Versão 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>Versão 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/russian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>Версия 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>Версия 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/spanish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>Versión 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>Versión 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/turkish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>Sürüm 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>Sürüm 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="391"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ts/urdu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,8 @@
</message>
<message>
<location filename="../ui.ui" line="78"/>
<source>Version 2.3.4</source>
<translation>ورژن 2.3.4</translation>
<source>Version 2.3.5</source>
<translation>ورژن 2.3.5</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down

0 comments on commit 6791ea1

Please sign in to comment.