diff --git a/.gitignore b/.gitignore index e42b6b9..1da736e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /EcuRsm/ /Output/ /pyren/*.zip +/pyren3/*.zip cache/ csv/ dumps/ @@ -15,7 +16,7 @@ EcuRenault/ Location/ .vscode/ BVMEXTRACTION/ -DDT2000data/ +DDT2000data*/ DocDB*/ MTCSAVE/ NML/ @@ -23,17 +24,14 @@ Params/ Python27/ *.pyc *.p +*.zip *.csv *.acf *.tdv *.bin -pyren/acf.py -pyren/history.txt -pyren/mod_acf_func.py -pyren/mod_acf_proc.py -pyren/mod_ddt_config.py -pyren/parser.out -pyren/parsetab.py -pyren/scen_appr_4valves.py -pyren/scen_ecri_fap2.py +pyren3/history.txt +pyren3/parser.out +pyren3/parsetab.py +pyren3/scen_appr_4valves.py +pyren3/scen_ecri_fap2.py diff --git a/_pyren3_launcher.py b/_pyren3_launcher.py index d961896..8fb042f 100755 --- a/_pyren3_launcher.py +++ b/_pyren3_launcher.py @@ -130,7 +130,7 @@ def update_from_gitlab(): continue source = zip_file.open(src) - target = file(dst, "wb") + target = open(dst, "wb") with source, target: shutil.copyfileobj(source, target) except: diff --git a/pyren3/mod_ddt_utils.py b/pyren3/mod_ddt_utils.py index f749c80..53fba11 100755 --- a/pyren3/mod_ddt_utils.py +++ b/pyren3/mod_ddt_utils.py @@ -57,6 +57,27 @@ class settings(): pickle.dump(self.__dict__, f) 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): comparers = [ ((itemgetter(col[1:].strip()), -1) if col.startswith('-') else (itemgetter(col.strip()), 1)) for col in columns] def comparer(left, right): @@ -66,7 +87,7 @@ def multikeysort(items, columns): return mult * result else: return 0 - return sorted(items, cmp=comparer) + return sorted(items, key=cmp_to_key(comparer)) def getPortList(): ret = []