Bugfix : échappement sur la sélection du fichier de commandes

This commit is contained in:
Philippe Roy 2023-02-07 03:40:50 +01:00
parent e8f64ece58
commit c904e135cc
2 changed files with 8 additions and 6 deletions

10
twin.py
View File

@ -129,7 +129,7 @@ def keyboard(cont):
def cmd_init(): def cmd_init():
# Fichier de config (screen size : data/config/screen/width-> [0][0].text, height-> [0][1].text) # Configuration de l'écran
bge.render.setWindowSize(int(twin_config[0][0].text),int(twin_config[0][1].text)) bge.render.setWindowSize(int(twin_config[0][0].text),int(twin_config[0][1].text))
quality_eevee=('NOSMAA', 'LOW', 'MEDIUM','HIGH','ULTRA') quality_eevee=('NOSMAA', 'LOW', 'MEDIUM','HIGH','ULTRA')
scene.objects['About']['quality'] = int(twin_config[0][2].text) scene.objects['About']['quality'] = int(twin_config[0][2].text)
@ -474,13 +474,14 @@ def file_open():
scene.objects['System']['file_proc'].terminate() scene.objects['System']['file_proc'].terminate()
# Démarrer le processus file # Démarrer le processus file
if sys.platform=="linux": # wxPython ne s'installe pas bien sur GNU/linux -> Qt6 if sys.platform=="linux": # wxPython ne s'installe pas bien sur GNU/linux -> Qt5
scene.objects['System']['file_proc'] = subprocess.Popen([sys.executable, os.path.join(os.getcwd(), "twin_file_qt.py")], stdout=subprocess.PIPE, encoding = 'utf8') scene.objects['System']['file_proc'] = subprocess.Popen([sys.executable, os.path.join(os.getcwd(), "twin_file_qt.py")], stdout=subprocess.PIPE, encoding = 'utf8')
else: # Qt6 ne s'installe pas bien sur Windows -> wxPython else: # Qt5 ne s'installe pas bien sur Windows -> wxPython
scene.objects['System']['file_proc'] = subprocess.Popen([sys.executable, os.path.join(os.getcwd(), "twin_file_wx.py")], stdout=subprocess.PIPE, encoding = 'utf8') scene.objects['System']['file_proc'] = subprocess.Popen([sys.executable, os.path.join(os.getcwd(), "twin_file_wx.py")], stdout=subprocess.PIPE, encoding = 'utf8')
# Récupérer le nom du fchier
stout = scene.objects['System']['file_proc'].communicate() stout = scene.objects['System']['file_proc'].communicate()
if stout[0][:-1] != 'None': if stout[0][:-1] != 'None' and len(stout[0][:-1])>0 :
scene.objects['System']['script'] = stout[0][:-1] scene.objects['System']['script'] = stout[0][:-1]
scene.objects['Script-text']['Text']=scene.objects['System']['script'] scene.objects['Script-text']['Text']=scene.objects['System']['script']
@ -544,6 +545,7 @@ def cycle_run ():
scene.objects['System']['time']=0 scene.objects['System']['time']=0
scene.objects['System']['daq']=False scene.objects['System']['daq']=False
scene.objects['System']['plot']=False scene.objects['System']['plot']=False
scene.objects['Twins-text']['Text'] = "Connection fermée."
module_name=os.path.split((scene.objects['System']['script']))[1][:-3] module_name=os.path.split((scene.objects['System']['script']))[1][:-3]
if python_validation(scene.objects['System']['script']): if python_validation(scene.objects['System']['script']):
runpy.run_path(scene.objects['System']['script'], run_name='start') # Execution du script utilisateur runpy.run_path(scene.objects['System']['script'], run_name='start') # Execution du script utilisateur

View File

@ -1,7 +1,7 @@
<data> <data>
<screen> <screen>
<width>1590</width> <width>1609</width>
<height>894</height> <height>905</height>
<quality>1</quality> <quality>1</quality>
</screen> </screen>
<plot> <plot>