9q fix#18 favTab save, ddt files and scenario read fix
This commit is contained in:
parent
3bbe509d54
commit
5af4999af1
@ -155,7 +155,8 @@ def get_file_from_clip( filename ):
|
|||||||
|
|
||||||
def file_in_clip( pattern ):
|
def file_in_clip( pattern ):
|
||||||
if mod_globals.clip_arc=='':
|
if mod_globals.clip_arc=='':
|
||||||
return pattern in glob.glob(os.path.join(mod_globals.cliproot, pattern))
|
pattern = os.path.join(mod_globals.cliproot, pattern)
|
||||||
|
return pattern in glob.glob(pattern)
|
||||||
else:
|
else:
|
||||||
file_list = mod_globals.clip_arc.namelist()
|
file_list = mod_globals.clip_arc.namelist()
|
||||||
return pattern in file_list
|
return pattern in file_list
|
||||||
@ -181,15 +182,15 @@ def get_file_list_from_ddt( pattern ):
|
|||||||
|
|
||||||
def file_in_ddt( pattern ):
|
def file_in_ddt( pattern ):
|
||||||
if mod_globals.ddt_arc=='':
|
if mod_globals.ddt_arc=='':
|
||||||
file_list = glob.glob(os.path.join(mod_globals.ddtroot, pattern))
|
li = glob.glob(os.path.join(mod_globals.ddtroot, pattern))
|
||||||
else:
|
else:
|
||||||
file_list = mod_globals.ddt_arc.namelist()
|
file_list = mod_globals.ddt_arc.namelist()
|
||||||
if '(' in pattern:
|
if '(' in pattern:
|
||||||
pattern = pattern.replace('(','\(')
|
pattern = pattern.replace('(','\(')
|
||||||
if ')' in pattern:
|
if ')' in pattern:
|
||||||
pattern = pattern.replace(')', '\)')
|
pattern = pattern.replace(')', '\)')
|
||||||
regex = re.compile(pattern)
|
regex = re.compile(pattern)
|
||||||
li = list(filter(regex.search, file_list))
|
li = list(filter(regex.search, file_list))
|
||||||
return len(li)
|
return len(li)
|
||||||
|
|
||||||
def path_in_ddt( pattern ):
|
def path_in_ddt( pattern ):
|
||||||
|
@ -503,6 +503,7 @@ class ECU:
|
|||||||
kb.set_normal_term()
|
kb.set_normal_term()
|
||||||
if mod_globals.opt_csv and csvf!=0:
|
if mod_globals.opt_csv and csvf!=0:
|
||||||
csvf.close()
|
csvf.close()
|
||||||
|
self.saveFavList()
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
n = ord(c)-ord('0')
|
n = ord(c)-ord('0')
|
||||||
@ -576,6 +577,19 @@ class ECU:
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def saveFavList(self):
|
||||||
|
fl = open("./cache/favlist_"+self.ecudata['ecuname']+".txt", "w")
|
||||||
|
for dr in favouriteScreen.datarefs:
|
||||||
|
if dr.name.startswith('P'):
|
||||||
|
for pr in self.Parameters.keys():
|
||||||
|
if dr.name == pr:
|
||||||
|
fl.write(self.Parameters[pr].agcdRef + "\n")
|
||||||
|
if dr.name.startswith('E'):
|
||||||
|
for st in self.States.keys():
|
||||||
|
if dr.name == st:
|
||||||
|
fl.write(self.States[st].agcdRef + "\n")
|
||||||
|
fl.close()
|
||||||
|
|
||||||
def show_subfunction(self, subfunction, path):
|
def show_subfunction(self, subfunction, path):
|
||||||
while(1):
|
while(1):
|
||||||
clearScreen()
|
clearScreen()
|
||||||
@ -782,17 +796,6 @@ class ECU:
|
|||||||
menu.append("<Up>")
|
menu.append("<Up>")
|
||||||
choice = Choice(menu, "Choose :")
|
choice = Choice(menu, "Choose :")
|
||||||
if choice[0]=="<Up>":
|
if choice[0]=="<Up>":
|
||||||
fl = open("./cache/favlist_"+self.ecudata['ecuname']+".txt", "w")
|
|
||||||
for dr in favouriteScreen.datarefs:
|
|
||||||
if dr.name.startswith('P'):
|
|
||||||
for pr in self.Parameters.keys():
|
|
||||||
if dr.name == pr:
|
|
||||||
fl.write(self.Parameters[pr].agcdRef + "\n")
|
|
||||||
if dr.name.startswith('E'):
|
|
||||||
for st in self.States.keys():
|
|
||||||
if dr.name == st:
|
|
||||||
fl.write(self.States[st].agcdRef + "\n")
|
|
||||||
fl.close()
|
|
||||||
favouriteScreen.datarefs = []
|
favouriteScreen.datarefs = []
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user