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 ):
|
||||
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:
|
||||
file_list = mod_globals.clip_arc.namelist()
|
||||
return pattern in file_list
|
||||
@ -181,15 +182,15 @@ def get_file_list_from_ddt( pattern ):
|
||||
|
||||
def file_in_ddt( pattern ):
|
||||
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:
|
||||
file_list = mod_globals.ddt_arc.namelist()
|
||||
if '(' in pattern:
|
||||
pattern = pattern.replace('(','\(')
|
||||
if ')' in pattern:
|
||||
pattern = pattern.replace(')', '\)')
|
||||
regex = re.compile(pattern)
|
||||
li = list(filter(regex.search, file_list))
|
||||
regex = re.compile(pattern)
|
||||
li = list(filter(regex.search, file_list))
|
||||
return len(li)
|
||||
|
||||
def path_in_ddt( pattern ):
|
||||
|
@ -503,6 +503,7 @@ class ECU:
|
||||
kb.set_normal_term()
|
||||
if mod_globals.opt_csv and csvf!=0:
|
||||
csvf.close()
|
||||
self.saveFavList()
|
||||
return
|
||||
else:
|
||||
n = ord(c)-ord('0')
|
||||
@ -574,7 +575,20 @@ class ECU:
|
||||
else:
|
||||
return st
|
||||
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):
|
||||
while(1):
|
||||
@ -782,17 +796,6 @@ class ECU:
|
||||
menu.append("<Up>")
|
||||
choice = Choice(menu, "Choose :")
|
||||
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 = []
|
||||
return
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user