Skip to content

Commit

Permalink
alpha 1.16.6 update
Browse files Browse the repository at this point in the history
将图形界面执行子进程逻辑微调,打包发布时不再需要gui_exec了
  • Loading branch information
DanDDXuanX committed Nov 7, 2022
1 parent b0eba08 commit 2395121
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
12 changes: 9 additions & 3 deletions gui/Application.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,15 @@ def __init__(self):
# 读取配置
self.load_configure()

# 获取python解释器的路径
self.python3 = sys.executable.replace('\\', '/')
# python3 = 'python' # exe发布版
# 获取解释器的路径
python3 = sys.executable.replace('\\', '/')
if python3.split('/')[-1] in ['py','py3','python','python3','python.exe','python3.exe']:
self.python3 = python3 + ' ./{}.py'
else:
if sys.platform == 'win32':
self.python3 = './RplGenCore.exe --module {}'
else:
self.python3 = './RplGenCore --module {}'

# 创建组件
self.create_widgets()
Expand Down
2 changes: 1 addition & 1 deletion gui/appframes/MainFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def run_command_main(self):
在命令行运行主程序
"""
optional = {1:'--OutputPath {of} ',2:'--ExportXML ',3:'--ExportVideo --Quality {ql} ',4:'--SynthesisAnyway --AccessKey {AK} --AccessKeySecret {AS} --Appkey {AP} --Azurekey {AZ} --ServRegion {SR} ',5:'--FixScreenZoom '}
command = self.app.python3 + ' ./replay_generator.py --LogFile {lg} --MediaObjDefine {md} --CharacterTable {ct} '
command = self.app.python3.format('replay_generator') + ' --LogFile {lg} --MediaObjDefine {md} --CharacterTable {ct} '
command = command + '--FramePerSecond {fps} --Width {wd} --Height {he} --Zorder {zd} --Language zh '
if self.app.output_path.get()!='':
command = command + optional[1].format(of=self.app.output_path.get().replace('\\','/'))
Expand Down
2 changes: 1 addition & 1 deletion gui/appframes/Mp4Frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def run_command_mp4(self):
"""
执行导出mp4的命令
"""
command = self.app.python3 + ' ./export_video.py --TimeLine {tm} --MediaObjDefine {md} --OutputPath {of} --FramePerSecond {fps} --Width {wd} --Height {he} --Zorder {zd} --Quality {ql} --Language zh '
command = self.app.python3.format('export_video') + ' --TimeLine {tm} --MediaObjDefine {md} --OutputPath {of} --FramePerSecond {fps} --Width {wd} --Height {he} --Zorder {zd} --Quality {ql} --Language zh '
if '' in [self.app.timeline_file.get(),self.app.media_define.get(),self.app.output_path.get(),
self.app.project_W.get(),self.app.project_H.get(),self.app.project_F.get(),self.app.project_Z.get(),self.app.project_Q.get()]:
messagebox.showerror(title='错误',message='缺少必要的参数!')
Expand Down
4 changes: 2 additions & 2 deletions gui/appframes/SynthFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def run_command_synth_preview(self,init_type='Aliyun'):
"""
执行试听命令
"""
command = self.app.python3 +' ./speech_synthesizer.py --PreviewOnly --Init {IN} --AccessKey {AK} --AccessKeySecret {AS} --Appkey {AP} --Azurekey {AZ} --ServRegion {SR} --Language zh '
command = self.app.python3.format('speech_synthesizer') +' --PreviewOnly --Init {IN} --AccessKey {AK} --AccessKeySecret {AS} --Appkey {AP} --Azurekey {AZ} --ServRegion {SR} --Language zh '
command = command.format(IN=init_type, AK=self.app.AccessKey.get(), AS=self.app.AccessKeySecret.get(),AP=self.app.Appkey.get(),AZ=self.app.AzureKey.get(),SR=self.app.ServiceRegion.get()).replace('\n','').replace('\r','')
try:
print('\x1B[32m'+command+'\x1B[0m')
Expand All @@ -115,7 +115,7 @@ def run_command_synth(self):
"""
执行语音合成命令
"""
command = self.app.python3 +' ./speech_synthesizer.py --LogFile {lg} --MediaObjDefine {md} --CharacterTable {ct} --OutputPath {of} --AccessKey {AK} --AccessKeySecret {AS} --Appkey {AP} --Azurekey {AZ} --ServRegion {SR} --Language zh '
command = self.app.python3.format('speech_synthesizer') +' --LogFile {lg} --MediaObjDefine {md} --CharacterTable {ct} --OutputPath {of} --AccessKey {AK} --AccessKeySecret {AS} --Appkey {AP} --Azurekey {AZ} --ServRegion {SR} --Language zh '
if '' in [self.app.stdin_logfile.get(),self.app.characor_table.get(),self.app.media_define.get(),self.app.output_path.get(),self.app.AccessKey.get(),self.app.AccessKeySecret.get(),self.app.Appkey.get(),self.app.AzureKey.get(),self.app.ServiceRegion.get()]:
messagebox.showerror(title='错误',message='缺少必要的参数!')
else:
Expand Down
2 changes: 1 addition & 1 deletion gui/appframes/XmlFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def create_widgets(self):

def run_command_xml(self):
"""执行导出xml的命令"""
command = self.app.python3 + ' ./export_xml.py --TimeLine {tm} --MediaObjDefine {md} --OutputPath {of} --FramePerSecond {fps} --Width {wd} --Height {he} --Zorder {zd} --Language zh '
command = self.app.python3.format('export_xml') + ' --TimeLine {tm} --MediaObjDefine {md} --OutputPath {of} --FramePerSecond {fps} --Width {wd} --Height {he} --Zorder {zd} --Language zh '
if '' in [self.app.timeline_file.get(),self.app.media_define.get(),self.app.output_path.get(),
self.app.project_W.get(),self.app.project_H.get(),self.app.project_F.get(),self.app.project_Z.get()]:
messagebox.showerror(title='错误',message='缺少必要的参数!')
Expand Down
2 changes: 1 addition & 1 deletion gui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from tkinter import colorchooser, filedialog, messagebox

EDITION = '1.16.5'
EDITION = '1.16.6'

def browse_file(text_obj, method='file',filetype=None):
"""
Expand Down

0 comments on commit 2395121

Please sign in to comment.