Python 3 fixes
This commit is contained in:
parent
d2187adfda
commit
39a83d2212
@ -415,7 +415,7 @@ class ECU:
|
|||||||
csv_filename = csv_filename.replace(' ','_')
|
csv_filename = csv_filename.replace(' ','_')
|
||||||
#if mod_globals.os == 'android':
|
#if mod_globals.os == 'android':
|
||||||
# csv_filename = csv_filename.encode("ascii","ignore")
|
# csv_filename = csv_filename.encode("ascii","ignore")
|
||||||
csvf = open("./csv/"+pyren_encode(csv_filename), "wt")
|
csvf = open("./csv/"+pyren_encode(csv_filename), "wb")
|
||||||
|
|
||||||
DTCpos = path.find('DTC')
|
DTCpos = path.find('DTC')
|
||||||
if DTCpos > 0:
|
if DTCpos > 0:
|
||||||
|
@ -467,30 +467,6 @@ class Port:
|
|||||||
self.hdr.timeout = 1
|
self.hdr.timeout = 1
|
||||||
self.hdr.baudrate = boudrate
|
self.hdr.baudrate = boudrate
|
||||||
|
|
||||||
# search ELM
|
|
||||||
tb = time.time () # start time
|
|
||||||
self.buff = ""
|
|
||||||
while True:
|
|
||||||
if not mod_globals.opt_demo:
|
|
||||||
byte = self.read ()
|
|
||||||
else:
|
|
||||||
byte = 'ELM'
|
|
||||||
if byte == '\r' or byte == '\n':
|
|
||||||
self.buff = ""
|
|
||||||
continue
|
|
||||||
self.buff += byte
|
|
||||||
tc = time.time ()
|
|
||||||
if ('ELM' in self.buff) or ('STN' in self.buff):
|
|
||||||
break
|
|
||||||
if (tc - tb) > 1:
|
|
||||||
print("ERROR - rate not supported. Let's go back.")
|
|
||||||
self.hdr.timeout = self.portTimeout
|
|
||||||
self.hdr.baudrate = mod_globals.opt_speed
|
|
||||||
self.rwLock = False
|
|
||||||
# disable at_keepalive
|
|
||||||
#self.elm_at_KeepAlive ()
|
|
||||||
return
|
|
||||||
|
|
||||||
self.write ("\r")
|
self.write ("\r")
|
||||||
|
|
||||||
# search >
|
# search >
|
||||||
@ -1534,8 +1510,8 @@ class ELM:
|
|||||||
tc = time.time() # current time
|
tc = time.time() # current time
|
||||||
self.screenRefreshTime += ST /1000.
|
self.screenRefreshTime += ST /1000.
|
||||||
if (tc - tb) * 1000. < ST:
|
if (tc - tb) * 1000. < ST:
|
||||||
target_time = time.clock() + (ST / 1000. - (tc - tb))
|
target_time = time.time() + (ST / 1000. - (tc - tb))
|
||||||
while time.clock() < target_time:
|
while time.time() < target_time:
|
||||||
pass
|
pass
|
||||||
tb = tc
|
tb = tc
|
||||||
|
|
||||||
@ -2195,7 +2171,7 @@ class ELM:
|
|||||||
# is lower than requeseted performance level
|
# is lower than requeseted performance level
|
||||||
while did_number < len(dataids) and len(param_to_send)/4 < level:
|
while did_number < len(dataids) and len(param_to_send)/4 < level:
|
||||||
# get another did
|
# get another did
|
||||||
did = dataids.keys()[did_number]
|
did = list(dataids)[did_number]
|
||||||
did_number += 1
|
did_number += 1
|
||||||
|
|
||||||
# exclude did_supported_in_range did
|
# exclude did_supported_in_range did
|
||||||
@ -2221,7 +2197,7 @@ class ELM:
|
|||||||
if any(s in resp for s in ['?', 'NR']) or len(resp) < predicted_response_length:
|
if any(s in resp for s in ['?', 'NR']) or len(resp) < predicted_response_length:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self.performanceModeLevel = len(param_to_send)/4
|
self.performanceModeLevel = len(param_to_send)//4
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user