fix tools

This commit is contained in:
shrlnm 2022-08-21 09:08:05 +03:00
parent 7d78e18160
commit e6e58704dc
5 changed files with 15 additions and 18 deletions

View File

@ -71,9 +71,7 @@ def optParser():
import argparse
parser = argparse.ArgumentParser(
#usage = "%prog -p <port> [options]",
version="acfg Version 1.0",
description = "acfg - auto configuration tool"
description = "acf - auto configuration tool"
)
parser.add_argument('-p',

View File

@ -646,8 +646,6 @@ def optParser():
global allvin
parser = argparse.ArgumentParser(
#usage = "%prog -p <port> [options]",
version="Document Viewer Version 1.0",
description = "Tool for view DocDb"
)

6
pyren3/mod_acf_func.py Executable file → Normal file
View File

@ -38,8 +38,8 @@ def acf_find_in_sirev( ref2, platform ):
if len(list(errone.keys()))==0:
se=zip.open('SIREV_ERRONE.dat')
cont=se.read()
for l in cont.split('\n'):
li = l.split('/')
for l in cont.split(b'\n'):
li = l.split(b'/')
if len(li)==6 and li[0]==platform:
errone[li[2]] = li[3]
@ -68,7 +68,7 @@ def acf_loadModules( de, refdata, platform ):
print("Configuration database: ", acfFile)
zip=zipfile.ZipFile(acfFile)
zip.setpassword('A710FBD006342FC8')
zip.setpassword(b'A710FBD006342FC8')
zipflist = zip.namelist()
module_list = []

15
pyren3/mod_acf_proc.py Executable file → Normal file
View File

@ -148,26 +148,27 @@ def acf_MTC_generateDefaults( m, mtc ):
for k, v in sorted( list(m['acf_wc'].items()), key=lambda x_y: x_y[1] ):
if mod_globals.opt_verbose or mod_globals.opt_verbose2:
try:
sf.write('#'*60 + '\n')
sf.write('# ' + k + '\n')
sf.write('#'*60 + '\n')
sf.write('# ' + k + '\n')
except:
pass
pass
if mod_globals.opt_verbose2:
for di in sorted(list(m['mo'].req[k].SentDI.values()), key=lambda x: x.FirstByte * 8 + x.BitOffset):
try:
sf.write(pyren_encode('## ' + di.Name + ' = ' + di.val + '\n'))
except:
try:
sf.write(pyren_encode('## ' + di.Name + ' = UNDEFINED\n'))
sf.write(pyren_encode('## ' + di.Name + ' = UNDEFINED\n'))
except:
pass
pass
sf.write(m['acf_wc'][k]+'\n')
# write trailer
sf.write('\n# VIN programming\n')
sf.write('\n# VIN programming !!!check the command!!!\n')
sf.write('#2EF190' + hex_VIN_plus_CRC(mod_globals.vin, False) +'\n')
sf.write('\n# reset ecu\n')
sf.write('#3B81' + hex_VIN_plus_CRC(mod_globals.vin, False) +'\n')
sf.write('\n# reset ecu or disconnect the battary!!!check the command!!!\n')
sf.write('#1101\n\n')
sf.write('exit\n')

6
pyren3/mod_db_manager.py Executable file → Normal file
View File

@ -159,9 +159,9 @@ def get_file_from_clip( filename ):
else:
encoding = 'utf-8'
if mode=='rb':
return open(os.path.join(mod_globals.cliproot, filename), mode)
return open(os.path.join(mod_globals.cliproot, filename), mode)
else:
return open(os.path.join(mod_globals.cliproot, filename), mode, encoding=encoding)
return open(os.path.join(mod_globals.cliproot, filename), mode, encoding=encoding)
else:
if filename.startswith('../'):
filename = filename[3:]
@ -228,7 +228,7 @@ def path_in_ddt( pattern ):
def get_file_from_ddt( filename ):
if mod_globals.ddt_arc=='':
return open(os.path.join(mod_globals.ddtroot, filename), 'r')
return open(os.path.join(mod_globals.ddtroot, filename), 'rb')
else:
return mod_globals.ddt_arc.open(filename, 'r')