some fixes with encoding and DB
This commit is contained in:
parent
253b597b96
commit
11cfdb4002
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -151,7 +151,16 @@ def get_file_from_clip( filename ):
|
|||||||
if mod_globals.clip_arc=='':
|
if mod_globals.clip_arc=='':
|
||||||
return open(os.path.join(mod_globals.cliproot, filename), mode)
|
return open(os.path.join(mod_globals.cliproot, filename), mode)
|
||||||
else:
|
else:
|
||||||
return mod_globals.clip_arc.open(filename, mode)
|
if filename.startswith('../'):
|
||||||
|
filename = filename[3:]
|
||||||
|
try:
|
||||||
|
f = mod_globals.clip_arc.open(filename, mode)
|
||||||
|
return f
|
||||||
|
except:
|
||||||
|
fn = filename.split('/')[-1]
|
||||||
|
lfn = fn.lower()
|
||||||
|
filename = filename.replace(fn,lfn)
|
||||||
|
return mod_globals.clip_arc.open(filename, mode)
|
||||||
|
|
||||||
def file_in_clip( pattern ):
|
def file_in_clip( pattern ):
|
||||||
if mod_globals.clip_arc=='':
|
if mod_globals.clip_arc=='':
|
||||||
|
@ -18,6 +18,7 @@ import string
|
|||||||
import mod_globals
|
import mod_globals
|
||||||
import mod_utils
|
import mod_utils
|
||||||
import mod_ecu
|
import mod_ecu
|
||||||
|
import mod_db_manager
|
||||||
from mod_utils import pyren_encode
|
from mod_utils import pyren_encode
|
||||||
from mod_utils import clearScreen
|
from mod_utils import clearScreen
|
||||||
from mod_utils import ASCIITOHEX
|
from mod_utils import ASCIITOHEX
|
||||||
@ -59,7 +60,7 @@ def run( elm, ecu, command, data ):
|
|||||||
#
|
#
|
||||||
# Data file parsing
|
# Data file parsing
|
||||||
#
|
#
|
||||||
DOMTree = xml.dom.minidom.parse(data)
|
DOMTree = xml.dom.minidom.parse(mod_db_manager.get_file_from_clip(data))
|
||||||
ScmRoom = DOMTree.documentElement
|
ScmRoom = DOMTree.documentElement
|
||||||
|
|
||||||
ScmParams = ScmRoom.getElementsByTagName("ScmParam")
|
ScmParams = ScmRoom.getElementsByTagName("ScmParam")
|
||||||
|
@ -18,6 +18,7 @@ import string
|
|||||||
import mod_globals
|
import mod_globals
|
||||||
import mod_utils
|
import mod_utils
|
||||||
import mod_ecu
|
import mod_ecu
|
||||||
|
import mod_db_manager
|
||||||
from mod_utils import pyren_encode
|
from mod_utils import pyren_encode
|
||||||
from mod_utils import clearScreen
|
from mod_utils import clearScreen
|
||||||
from mod_utils import ASCIITOHEX
|
from mod_utils import ASCIITOHEX
|
||||||
@ -76,10 +77,10 @@ def run( elm, ecu, command, data ):
|
|||||||
#
|
#
|
||||||
# Data file parsing
|
# Data file parsing
|
||||||
#
|
#
|
||||||
DOMTree = xml.dom.minidom.parse(data)
|
DOMTree = xml.dom.minidom.parse(mod_db_manager.get_file_from_clip(data))
|
||||||
ScmRoom = DOMTree.documentElement
|
ScmRoom = DOMTree.documentElement
|
||||||
|
|
||||||
root = et.parse(data).getroot()
|
root = et.parse(mod_db_manager.get_file_from_clip(data)).getroot()
|
||||||
|
|
||||||
ScmParams = ScmRoom.getElementsByTagName("ScmParam")
|
ScmParams = ScmRoom.getElementsByTagName("ScmParam")
|
||||||
|
|
||||||
@ -308,22 +309,22 @@ def run( elm, ecu, command, data ):
|
|||||||
print '*'*80
|
print '*'*80
|
||||||
print get_message("MessageBox2")
|
print get_message("MessageBox2")
|
||||||
print
|
print
|
||||||
ch = raw_input(confirm + ' <YES/NO>: ')
|
ch = raw_input(pyren_encode(confirm + ' <YES/NO>: '))
|
||||||
if ch.upper()!='YES':
|
if ch.upper()!='YES':
|
||||||
return
|
return
|
||||||
mileage = raw_input(mileageText + ' (' + mileageUnit + ')' + ': ')
|
mileage = raw_input(pyren_encode(mileageText + ' (' + mileageUnit + ')' + ': '))
|
||||||
while not (mileage.isdigit() and 2 <= len(mileage) <= 6 and int(mileage) >= 10):
|
while not (mileage.isdigit() and 2 <= len(mileage) <= 6 and int(mileage) >= 10):
|
||||||
print get_message("MessageBox1")
|
print get_message("MessageBox1")
|
||||||
print
|
print
|
||||||
mileage = raw_input(mileageText + ' (' + mileageUnit + ')' + ': ')
|
mileage = raw_input(pyren_encode(mileageText + ' (' + mileageUnit + ')' + ': '))
|
||||||
|
|
||||||
clearScreen()
|
clearScreen()
|
||||||
|
|
||||||
print mileageText + ': ' + mileage + ' ' + mileageUnit
|
print mileageText + ': ' + mileage + ' ' + mileageUnit
|
||||||
print
|
print
|
||||||
ch = raw_input(confirm + ' <YES/NO>: ')
|
ch = raw_input(pyren_encode(confirm + ' <YES/NO>: '))
|
||||||
while (ch.upper()!='YES') and (ch.upper()!='NO'):
|
while (ch.upper()!='YES') and (ch.upper()!='NO'):
|
||||||
ch = raw_input(confirm + ' <YES/NO>: ')
|
ch = raw_input(pyren_encode(confirm + ' <YES/NO>: '))
|
||||||
if ch.upper()!='YES':
|
if ch.upper()!='YES':
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -452,9 +453,9 @@ def run( elm, ecu, command, data ):
|
|||||||
print get_message_by_id('55663')
|
print get_message_by_id('55663')
|
||||||
print '*'*80
|
print '*'*80
|
||||||
print
|
print
|
||||||
ch = raw_input(confirm + ' <YES/NO>: ')
|
ch = raw_input(pyren_encode(confirm + ' <YES/NO>: '))
|
||||||
while (ch.upper()!='YES') and (ch.upper()!='NO'):
|
while (ch.upper()!='YES') and (ch.upper()!='NO'):
|
||||||
ch = raw_input(confirm + ' <YES/NO>: ')
|
ch = raw_input(pyren_encode(confirm + ' <YES/NO>: '))
|
||||||
if ch.upper()!='YES':
|
if ch.upper()!='YES':
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import string
|
|||||||
import mod_globals
|
import mod_globals
|
||||||
import mod_utils
|
import mod_utils
|
||||||
import mod_ecu
|
import mod_ecu
|
||||||
|
import mod_db_manager
|
||||||
from mod_utils import pyren_encode
|
from mod_utils import pyren_encode
|
||||||
from mod_utils import clearScreen
|
from mod_utils import clearScreen
|
||||||
from mod_utils import ASCIITOHEX
|
from mod_utils import ASCIITOHEX
|
||||||
@ -75,10 +76,10 @@ def run( elm, ecu, command, data ):
|
|||||||
#
|
#
|
||||||
# Data file parsing
|
# Data file parsing
|
||||||
#
|
#
|
||||||
DOMTree = xml.dom.minidom.parse(data)
|
DOMTree = xml.dom.minidom.parse(mod_db_manager.get_file_from_clip(data))
|
||||||
ScmRoom = DOMTree.documentElement
|
ScmRoom = DOMTree.documentElement
|
||||||
|
|
||||||
root = et.parse(data).getroot()
|
root = et.parse(mod_db_manager.get_file_from_clip(data)).getroot()
|
||||||
|
|
||||||
ScmParams = ScmRoom.getElementsByTagName("ScmParam")
|
ScmParams = ScmRoom.getElementsByTagName("ScmParam")
|
||||||
|
|
||||||
@ -253,20 +254,20 @@ def run( elm, ecu, command, data ):
|
|||||||
print '*'*80
|
print '*'*80
|
||||||
print get_message("MessageBox2")
|
print get_message("MessageBox2")
|
||||||
print
|
print
|
||||||
ch = raw_input(confirm + ' <YES/NO>: ')
|
ch = raw_input(pyren_encode(confirm + ' <YES/NO>: '))
|
||||||
if ch.upper()!='YES':
|
if ch.upper()!='YES':
|
||||||
return
|
return
|
||||||
mileage = raw_input(mileageText + ' (' + mileageUnit + ')' + ': ')
|
mileage = raw_input(pyren_encode(mileageText + ' (' + mileageUnit + ')' + ': '))
|
||||||
while not (mileage.isdigit() and 2 <= len(mileage) <= 6 and int(mileage) >= 10):
|
while not (mileage.isdigit() and 2 <= len(mileage) <= 6 and int(mileage) >= 10):
|
||||||
print get_message("MessageBox1")
|
print get_message("MessageBox1")
|
||||||
print
|
print
|
||||||
mileage = raw_input(mileageText + ' (' + mileageUnit + ')' + ': ')
|
mileage = raw_input(pyren_encode(mileageText + ' (' + mileageUnit + ')' + ': '))
|
||||||
|
|
||||||
clearScreen()
|
clearScreen()
|
||||||
|
|
||||||
print mileageText + ': ' + mileage + ' ' + mileageUnit
|
print mileageText + ': ' + mileage + ' ' + mileageUnit
|
||||||
print
|
print
|
||||||
ch = raw_input(confirm + ' <YES/NO>: ')
|
ch = raw_input(pyren_encode(confirm + ' <YES/NO>: '))
|
||||||
while (ch.upper()!='YES') and (ch.upper()!='NO'):
|
while (ch.upper()!='YES') and (ch.upper()!='NO'):
|
||||||
ch = raw_input(confirm + ' <YES/NO>: ')
|
ch = raw_input(confirm + ' <YES/NO>: ')
|
||||||
if ch.upper()!='YES':
|
if ch.upper()!='YES':
|
||||||
@ -393,7 +394,7 @@ def run( elm, ecu, command, data ):
|
|||||||
print get_message_by_id('55663')
|
print get_message_by_id('55663')
|
||||||
print '*'*80
|
print '*'*80
|
||||||
print
|
print
|
||||||
ch = raw_input(confirm + ' <YES/NO>: ')
|
ch = raw_input(pyren_encode(confirm + ' <YES/NO>: '))
|
||||||
while (ch.upper()!='YES') and (ch.upper()!='NO'):
|
while (ch.upper()!='YES') and (ch.upper()!='NO'):
|
||||||
ch = raw_input(confirm + ' <YES/NO>: ')
|
ch = raw_input(confirm + ' <YES/NO>: ')
|
||||||
if ch.upper()!='YES':
|
if ch.upper()!='YES':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user