Skip to content

Commit

Permalink
<fix> fix unable to unpack due to path problem
Browse files Browse the repository at this point in the history
update version to v2.3.6
  • Loading branch information
anonymousException committed Jun 5, 2024
1 parent 0bab428 commit 8eb2ecf
Show file tree
Hide file tree
Showing 37 changed files with 46 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/extraction_official_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_translate_cmd(game_path, tl_name):
python_path = get_python_path(game_path)
py_path = get_py_path(game_path)
game_dir = os.path.dirname(game_path)
command = python_path + ' -O "' + py_path + '" "' + game_dir + '" translate "' + tl_name + '"'
command = '"' + python_path + '"' + ' -O "' + py_path + '" "' + game_dir + '" translate "' + tl_name + '"'
return command


Expand Down
2 changes: 1 addition & 1 deletion src/font_replace_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def openFontStyleFile(self):
select_dir = select_dir.replace('file:///', '')
if select_dir[len(select_dir) - 1] != '/' and select_dir[len(select_dir) - 1] != '\\':
select_dir = select_dir + '/'
command = 'notepad ' + select_dir + 'gui.rpy'
command = 'notepad ' + '"' + select_dir + 'gui.rpy' + '"'
p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
creationflags=0x08000000, text=True, encoding='utf-8')
p.wait()
Expand Down
4 changes: 2 additions & 2 deletions src/game_unpacker_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_unrpyc_command(game_path):
python_path = get_python_path(game_path)
game_dir = os.path.dirname(game_path)
unrpyc_path = game_dir + '/unrpyc.py'
command = python_path + ' -O "' + unrpyc_path + '" "' + game_dir + '"'
command = '"' + python_path + '" -O "' + unrpyc_path + '" "' + game_dir + '"'
return command


Expand Down Expand Up @@ -179,7 +179,7 @@ def unpack(self):
f = io.open(hook_script, mode='w', encoding='utf-8')
f.writelines(_read_lines)
f.close()
command = path
command = '"' + path + '"'
self.path = path
f = io.open(dir + finish_flag, 'w')
f.write('waiting')
Expand Down
7 changes: 6 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io
import multiprocessing
import os.path
import shutil
import subprocess
import sys
import time
Expand Down Expand Up @@ -488,14 +489,18 @@ def __del__(self):
self.wait()

def run(self):
f = io.open(log_path, 'r+',encoding='utf-8')
f = io.open(log_path, 'r+', encoding='utf-8')
try:
self.update_date.emit(f.read())
except Exception as e:
f.close()
shutil.copyfile(log_path, log_path + '.error.txt')
f = io.open(log_path, 'w')
f.write('Log Format UnicodeEncodeError! Log Cleared')
f.close()
command = 'notepad ' + log_path + '.error.txt'
p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
creationflags=0x08000000, text=True, encoding='utf-8')
f = io.open(log_path, 'r+', encoding='utf-8')
f.close()

Expand Down
2 changes: 1 addition & 1 deletion src/one_key_translate_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def unpack(self):
f = io.open(game_unpacker_form.hook_script, mode='w', encoding='utf-8')
f.writelines(_read_lines)
f.close()
command = path
command = '"' +path+'"'
self.path = path
f = io.open(dir + finish_flag, 'w')
f.write('waiting')
Expand Down
4 changes: 2 additions & 2 deletions src/pack_game_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,15 @@ def pack_from_list(python_path, pack_list, target_path):
if not os.path.isfile(target_path):
i = pack_list[0]
basename = i[len(game_dir):].strip('/').strip('\\')
command = python_path + f' -O "{rpa_script_path}" -c "{target_path}" "{basename}"="{i}"'
command = '"' + python_path + '"' + f' -O "{rpa_script_path}" -c "{target_path}" "{basename}"="{i}"'
log_print(command)
p = subprocess.Popen(command, shell=True, stdout=my_log.f, stderr=my_log.f,
creationflags=0x08000000, text=True, encoding='utf-8')
p.wait()
pack_list.pop(0)
for i in pack_list:
basename = i[len(game_dir):].strip('/').strip('\\')
command = python_path + f' -O "{rpa_script_path}" -a "{target_path}" "{basename}"="{i}"'
command = '"' + python_path + '"' + f' -O "{rpa_script_path}" -a "{target_path}" "{basename}"="{i}"'
log_print(command)
p = subprocess.Popen(command, shell=True, stdout=my_log.f, stderr=my_log.f,
creationflags=0x08000000, text=True, encoding='utf-8')
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.5</source>
<translation>الإصدار2.3.5</translation>
<source>Version 2.3.6</source>
<translation>الإصدار2.3.6</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.5</source>
<translation>সংস্করণ 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>সংস্করণ 2.3.6</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.5</source>
<translation>版本 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>版本 2.3.6</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.5</source>
<source>Version 2.3.6</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.5</source>
<translation>Version 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>Version 2.3.6</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.5</source>
<translation>Version 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>Version 2.3.6</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.5</source>
<translation>Έκδοση 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>Έκδοση 2.3.6</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.5</source>
<translation>संस्करण 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>संस्करण 2.3.6</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.5</source>
<translation>バージョン2.3.5</translation>
<source>Version 2.3.6</source>
<translation>バージョン2.3.6</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.5</source>
<translation>버전 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>버전 2.3.6</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.5</source>
<translation>Versão 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>Versão 2.3.6</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.5</source>
<translation>Версия 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>Версия 2.3.6</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.5</source>
<translation>Versión 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>Versión 2.3.6</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.5</source>
<translation>Sürüm 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>Sürüm 2.3.6</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.5</source>
<translation>ورژن 2.3.5</translation>
<source>Version 2.3.6</source>
<translation>ورژن 2.3.6</translation>
</message>
<message>
<location filename="../ui.ui" line="113"/>
Expand Down
4 changes: 2 additions & 2 deletions src/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def setupUi(self, MainWindow):
self.actionpack_game_files.setObjectName(u"actionpack_game_files")
self.actionGreek = QAction(MainWindow)
self.actionGreek.setObjectName(u"actionGreek")
self.actionGreek.setText(u"Greek")
self.centralwidget = QWidget(MainWindow)
self.centralwidget.setObjectName(u"centralwidget")
self.gridLayout = QGridLayout(self.centralwidget)
Expand Down Expand Up @@ -381,10 +382,9 @@ def retranslateUi(self, MainWindow):
self.actionofficial_extraction.setText(QCoreApplication.translate("MainWindow", u"official extraction", None))
self.actionconvert_txt_to_html.setText(QCoreApplication.translate("MainWindow", u"convert txt to html", None))
self.actionpack_game_files.setText(QCoreApplication.translate("MainWindow", u"pack game files", None))
self.actionGreek.setText(QCoreApplication.translate("MainWindow", u"Greek", None))
self.clearLogBtn.setText(QCoreApplication.translate("MainWindow", u"clear log", None))
self.copyrightLabel.setText(QCoreApplication.translate("MainWindow", u"\u00a92024 Last moment,All rights reserved.", None))
self.versionLabel.setText(QCoreApplication.translate("MainWindow", u"Version 2.3.5", None))
self.versionLabel.setText(QCoreApplication.translate("MainWindow", u"Version 2.3.6", None))
self.translateBtn.setText(QCoreApplication.translate("MainWindow", u"translate", None))
self.selectFilesBtn.setText(QCoreApplication.translate("MainWindow", u"...", None))
self.label_2.setText(QCoreApplication.translate("MainWindow", u"directory", None))
Expand Down
4 changes: 2 additions & 2 deletions src/ui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</size>
</property>
<property name="text">
<string>Version 2.3.5</string>
<string>Version 2.3.6</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -782,7 +782,7 @@
</action>
<action name="actionGreek">
<property name="text">
<string>Greek</string>
<string notr="true">Greek</string>
</property>
</action>
</widget>
Expand Down

0 comments on commit 8eb2ecf

Please sign in to comment.