fix ddt settings.p to settings3.p optimise environement (venv python 3.8.9 mac os)

This commit is contained in:
--=FurtiF™=-- 2022-08-21 17:32:04 +02:00
parent 406a5f12b7
commit ed753d8477
46 changed files with 118 additions and 116 deletions

6
.gitignore vendored
View File

@ -1,5 +1,4 @@
/.idea/ /.idea/
/.DS_Store
/EcuDacia/ /EcuDacia/
/EcuRsm/ /EcuRsm/
/Output/ /Output/
@ -22,6 +21,9 @@ MTCSAVE/
NML/ NML/
Params/ Params/
Python27/ Python27/
/build/
/.intino/
/venv/
*.pyc *.pyc
*.p *.p
*.zip *.zip
@ -29,9 +31,9 @@ Python27/
*.acf *.acf
*.tdv *.tdv
*.bin *.bin
*.DS_Store
pyren3/history.txt pyren3/history.txt
pyren3/parser.out pyren3/parser.out
pyren3/parsetab.py pyren3/parsetab.py
pyren3/scen_appr_4valves.py pyren3/scen_appr_4valves.py
pyren3/scen_ecri_fap2.py pyren3/scen_ecri_fap2.py

View File

@ -1,4 +1,5 @@
@echo off @echo off
echo Run's app ... echo Run's app ...
python27\python.exe _pyren_launcher.py rem uses python3
python3.exe _pyren3_launcher.py
pause pause

View File

@ -12,6 +12,6 @@
#./venv/bin/activate #./venv/bin/activate
printf "Runs app ...\n" printf "Runs app ...\n"
#./venv/bin/python ./_pyren_launcher.py #./venv/bin/python ./_pyren_launcher.py
python ./_pyren_launcher.py python3 ./_pyren3_launcher.py
#printf "Deactivate venv ..." #printf "Deactivate venv ..."
#./venv/bin/deactivate #./venv/bin/deactivate

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import sys, os import sys, os
import mod_globals import mod_globals

View File

@ -1,10 +1,10 @@
#!/usr/bin/env python #!/usr/bin/env python3
import sys, os import sys, os
import time import time
import mod_globals import mod_globals
import pyren import pyren3
cmdb = ''' cmdb = '''
#v1.0 ;AC P; ATZ ; Z ; reset all #v1.0 ;AC P; ATZ ; Z ; reset all

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# ______ ___ ___ ___ ___ ___ ______ __ _______ # ______ ___ ___ ___ ___ ___ ______ __ _______
# | ___| \ \ / / / \ | \/ | | _ \ | | | ____| # | ___| \ \ / / / \ | \/ | | _ \ | | | ____|
@ -13,7 +13,7 @@ import time
import mod_globals import mod_globals
import mod_ecu import mod_ecu
import pyren import pyren3
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0]))) os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])))

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import sys, os import sys, os
import time import time
@ -7,7 +7,7 @@ import mod_db_manager
import mod_globals import mod_globals
import mod_ecu import mod_ecu
import pyren import pyren3
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0]))) os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])))

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import sys, os import sys, os
#import serial #import serial

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import sys, os import sys, os
import serial import serial

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import sys import sys
import os import os

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import sys import sys
import os import os

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import os import os
import re import re

View File

@ -631,7 +631,7 @@ class DDTLauncher():
ecu['xml'], ecu['xml'],
ecu['dump'], ecu['dump'],
ecu['ses']] ecu['ses']]
fout.write(str(';'.join(e)).encode("ascii", "ignore") + '\n') fout.write(';'.join(e) + '\n')
fout.close() fout.close()
copyfile(filename, "./savedCAR_prev.csv") copyfile(filename, "./savedCAR_prev.csv")

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys, os import sys, os

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import gc import gc

View File

@ -44,16 +44,16 @@ class settings():
pass pass
def load(self): def load(self):
if not os.path.isfile("../settings.p"): if not os.path.isfile("../settings3.p"):
self.save() self.save()
f = open('../settings.p', 'rb') f = open('../settings3.p', 'rb')
tmp_dict = pickle.load(f) tmp_dict = pickle.load(f)
f.close() f.close()
self.__dict__.update(tmp_dict) self.__dict__.update(tmp_dict)
def save(self): def save(self):
f = open('../settings.p', 'wb') f = open('../settings3.p', 'wb')
pickle.dump(self.__dict__, f) pickle.dump(self.__dict__, f)
f.close() f.close()

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from xml.dom.minidom import parse from xml.dom.minidom import parse
import xml.dom.minidom import xml.dom.minidom

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from mod_utils import Choice from mod_utils import Choice
from mod_utils import ChoiceFromDict from mod_utils import ChoiceFromDict

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from mod_ecu_service import ecu_mnemolocation from mod_ecu_service import ecu_mnemolocation
from mod_utils import pyren_encode from mod_utils import pyren_encode

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from mod_ecu_mnemonic import * from mod_ecu_mnemonic import *
from mod_ecu_screen import * from mod_ecu_screen import *

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from mod_ecu_mnemonic import * from mod_ecu_mnemonic import *
from mod_utils import Choice from mod_utils import Choice

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from mod_ecu_service import * from mod_ecu_service import *

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from mod_ecu_mnemonic import * from mod_ecu_mnemonic import *
from mod_utils import Choice from mod_utils import Choice

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import os import os
import re import re

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from mod_utils import Choice from mod_utils import Choice
from xml.dom.minidom import parse from xml.dom.minidom import parse

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from mod_utils import Choice from mod_utils import Choice
from mod_utils import pyren_encode from mod_utils import pyren_encode

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
from mod_ecu_mnemonic import * from mod_ecu_mnemonic import *
from mod_utils import Choice from mod_utils import Choice

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
""" """
module contains class for working with ELM327 module contains class for working with ELM327
version: 180408 version: 180408

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
opt_debug = False opt_debug = False
debug_file = None debug_file = None

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import csv import csv
import os import os

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import sys import sys
sys.path.insert(0,"../..") sys.path.insert(0,"../..")

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
''' '''
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
''' '''
Scenarium usage example Scenarium usage example

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
''' '''
Scenarium usage example Scenarium usage example

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
''' '''
Scenarium usage example Scenarium usage example

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
''' '''
Scenarium usage example Scenarium usage example

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
''' '''
Version: 180402 Version: 180402

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import os import os
import sys import sys
@ -14,75 +14,74 @@ from mod_utils import pyren_encode
from mod_utils import KBHit from mod_utils import KBHit
import xml.dom.minidom import xml.dom.minidom
def run( elm, ecu, command, data ):
clearScreen() def run(elm, ecu, command, data):
header = '['+command.codeMR+'] '+command.label clearScreen()
header = '[' + command.codeMR + '] ' + command.label
ScmSet = {}
ScmParam = {}
def get_message( msg ): ScmSet = {}
if msg in list(ScmParam.keys()): ScmParam = {}
value = ScmParam[msg]
else:
value = msg
if value.isdigit() and value in list(mod_globals.language_dict.keys()):
value = pyren_encode( mod_globals.language_dict[value] )
return value
def get_message_by_id( id ): def get_message(msg):
if id.isdigit() and id in list(mod_globals.language_dict.keys()): if msg in list(ScmParam.keys()):
value = pyren_encode( mod_globals.language_dict[id] ) value = ScmParam[msg]
return value else:
value = msg
if value.isdigit() and value in list(mod_globals.language_dict.keys()):
value = pyren_encode(mod_globals.language_dict[value])
return value
def get_message_by_id(id):
if id.isdigit() and id in list(mod_globals.language_dict.keys()):
value = pyren_encode(mod_globals.language_dict[id])
return value
DOMTree = xml.dom.minidom.parse(mod_db_manager.get_file_from_clip(data)) DOMTree = xml.dom.minidom.parse(mod_db_manager.get_file_from_clip(data))
ScmRoom = DOMTree.documentElement ScmRoom = DOMTree.documentElement
ScmParams = ScmRoom.getElementsByTagName("ScmParam")
for Param in ScmParams:
name = pyren_encode( Param.getAttribute("name") )
value = pyren_encode( Param.getAttribute("value") )
ScmParam[name] = value
kb = KBHit()
mainText = get_message('TexteTitre')
important = get_message('TexteConsigne')
tilt = get_message('TexteValeurInclinaison')
degreeSymbol = get_message('TexteDegre')
value2, datastr2 = ecu.get_pr(ScmParam['ParametreInclinaison'])
clearScreen() ScmParams = ScmRoom.getElementsByTagName("ScmParam")
print(pyren_encode(header))
print(mainText)
print('*'*80)
print()
print(important)
print()
ch = input('Do you want to continue? <yes/no> ') for Param in ScmParams:
while (ch.upper() != 'YES') and (ch.upper()!= 'NO'): name = pyren_encode(Param.getAttribute("name"))
ch = input('Do you want to continue? <yes/no> ') value = pyren_encode(Param.getAttribute("value"))
if ch.upper() != 'YES':
return
clearScreen()
cmd = ecu.get_ref_cmd(get_message('Commande1'))
resVal = ScmParam['ParametreCommande1']
print('*'*80)
responce = ecu.run_cmd(ScmParam['Commande1'], resVal)
print('*'*80)
if 'NR' in responce:
print(get_message('TexteProcedureInterompue'))
else:
print(get_message('TexteInitialisationEffectuee'))
print()
print(tilt, pyren_encode(':'), value2, degreeSymbol)
print()
ch = input('Press ENTER to exit') ScmParam[name] = value
return
kb = KBHit()
mainText = get_message('TexteTitre')
important = get_message('TexteConsigne')
tilt = get_message('TexteValeurInclinaison')
degreeSymbol = get_message('TexteDegre')
value2, datastr2 = ecu.get_pr(ScmParam['ParametreInclinaison'])
clearScreen()
print(pyren_encode(header))
print(mainText)
print('*' * 80)
print()
print(important)
print()
ch = input('Do you want to continue? <yes/no> ')
while (ch.upper() != 'YES') and (ch.upper() != 'NO'):
ch = input('Do you want to continue? <yes/no> ')
if ch.upper() != 'YES':
return
clearScreen()
cmd = ecu.get_ref_cmd(get_message('Commande1'))
resVal = ScmParam['ParametreCommande1']
print('*' * 80)
responce = ecu.run_cmd(ScmParam['Commande1'], resVal)
print('*' * 80)
if 'NR' in responce:
print(get_message('TexteProcedureInterompue'))
else:
print(get_message('TexteInitialisationEffectuee'))
print()
print(tilt, pyren_encode(':'), value2, degreeSymbol)
print()
ch = input('Press ENTER to exit')
return

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
''' '''
Scenarium usage example Scenarium usage example

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
''' '''
Scenarium usage example Scenarium usage example

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
''' '''
Scenarium usage example Scenarium usage example

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
''' '''
Scenarium usage example Scenarium usage example

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
''' '''
Scenarium usage example Scenarium usage example