-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmdr_4a_launcher.py
executable file
·60 lines (42 loc) · 1.5 KB
/
cmdr_4a_launcher.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/python
#-*-coding:utf8;-*-
#qpy:2
#qpy:console
#enter file name without .py
cmdr_file = 'cmdr_odometr'
#cmdr_file = 'cmdr_example'
import os
import sys
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])))
pa = [os.path.abspath(name) for name in os.listdir(".") if os.path.isdir(name) and name.lower().startswith('pyren')][0]
if len(sys.argv)==1:
sys.path.insert( 0, pa )
sys.path.insert( 0, pa+"\\ply" )
#tcfe = 'import ' + cmdr_file + ' as cmdr'
#exec( tcfe )
cmdr = __import__( cmdr_file )
#### fake port for not to left empty
sys.argv.append('-pbt')
#### demo mode without connecting to car
#sys.argv.append('--demo')
#### save responses of all 21xx and 22xxxx commands for demo mode
#sys.argv.append('--dump')
#### you should define it or you've been asked later
#sys.argv.append('-e'); sys.argv.append('10706')
#### ignore existence of savedEcus.p and do new scanning
#sys.argv.append('--scan')
#### commander would log any way but you can define new name
#sys.argv.append('--log'); sys.argv.append('log.txt')
#### switch to english. Remove all FG/SG files from cache directory
#sys.argv.append('-LGB')
#### try SlowInit before FastInit
#sys.argv.append('--si')
#### turn off automatic FC and do it by script
#sys.argv.append('--cfc')
#### turn off L1 cache
#sys.argv.append('--n1c')
os.chdir(pa)
cmdr.main()
else:
os.system("cd "+pa)
os.system("python "+cmdr_file+".py "+(' '.join(sys.argv[1:])))