fix lancher and mod_ddt

This commit is contained in:
shrlnm 2022-08-16 10:04:19 +03:00
parent b7b8230532
commit 896c576c5e
3 changed files with 31 additions and 12 deletions

18
.gitignore vendored
View File

@ -4,6 +4,7 @@
/EcuRsm/ /EcuRsm/
/Output/ /Output/
/pyren/*.zip /pyren/*.zip
/pyren3/*.zip
cache/ cache/
csv/ csv/
dumps/ dumps/
@ -15,7 +16,7 @@ EcuRenault/
Location/ Location/
.vscode/ .vscode/
BVMEXTRACTION/ BVMEXTRACTION/
DDT2000data/ DDT2000data*/
DocDB*/ DocDB*/
MTCSAVE/ MTCSAVE/
NML/ NML/
@ -23,17 +24,14 @@ Params/
Python27/ Python27/
*.pyc *.pyc
*.p *.p
*.zip
*.csv *.csv
*.acf *.acf
*.tdv *.tdv
*.bin *.bin
pyren/acf.py pyren3/history.txt
pyren/history.txt pyren3/parser.out
pyren/mod_acf_func.py pyren3/parsetab.py
pyren/mod_acf_proc.py pyren3/scen_appr_4valves.py
pyren/mod_ddt_config.py pyren3/scen_ecri_fap2.py
pyren/parser.out
pyren/parsetab.py
pyren/scen_appr_4valves.py
pyren/scen_ecri_fap2.py

View File

@ -130,7 +130,7 @@ def update_from_gitlab():
continue continue
source = zip_file.open(src) source = zip_file.open(src)
target = file(dst, "wb") target = open(dst, "wb")
with source, target: with source, target:
shutil.copyfileobj(source, target) shutil.copyfileobj(source, target)
except: except:

View File

@ -57,6 +57,27 @@ class settings():
pickle.dump(self.__dict__, f) pickle.dump(self.__dict__, f)
f.close() f.close()
def cmp_to_key(mycmp):
class K(object):
def __init__(self, obj, *args):
self.obj = obj
def __lt__(self, other):
return mycmp(self.obj, other.obj) < 0
def __gt__(self, other):
return mycmp(self.obj, other.obj) > 0
def __eq__(self, other):
return mycmp(self.obj, other.obj) == 0
def __le__(self, other):
return mycmp(self.obj, other.obj) <= 0
def __ge__(self, other):
return mycmp(self.obj, other.obj) >= 0
def __ne__(self, other):
return mycmp(self.obj, other.obj) != 0
return K
def cmp(a, b):
return (a > b) - (a < b)
def multikeysort(items, columns): def multikeysort(items, columns):
comparers = [ ((itemgetter(col[1:].strip()), -1) if col.startswith('-') else (itemgetter(col.strip()), 1)) for col in columns] comparers = [ ((itemgetter(col[1:].strip()), -1) if col.startswith('-') else (itemgetter(col.strip()), 1)) for col in columns]
def comparer(left, right): def comparer(left, right):
@ -66,7 +87,7 @@ def multikeysort(items, columns):
return mult * result return mult * result
else: else:
return 0 return 0
return sorted(items, cmp=comparer) return sorted(items, key=cmp_to_key(comparer))
def getPortList(): def getPortList():
ret = [] ret = []