mirror of
https://github.com/travisgoodspeed/goodwatch
synced 2024-11-21 15:48:02 +00:00
More fixes for python3. #131
This commit is contained in:
parent
b02f66a033
commit
efa975b477
@ -245,7 +245,6 @@ class BSL:
|
||||
adr=int(line[3:7],16);
|
||||
verb=int(line[7:9],16);
|
||||
|
||||
#data=line[9:(9+length*2)].decode('hex'); #Python2
|
||||
data=bytes.fromhex(line[9:(9+length*2)])
|
||||
if verb==0: #Data
|
||||
self.write(adr,data);
|
||||
@ -266,21 +265,24 @@ class BSL:
|
||||
adr=int(line[3:7],16);
|
||||
verb=int(line[7:9],16);
|
||||
|
||||
data=line[9:(9+length*2)].decode('hex');
|
||||
#data=line[9:(9+length*2)];
|
||||
data=bytes.fromhex(line[9:(9+length*2)])
|
||||
if verb==0 and adr>=0xFFE0:
|
||||
#Return the password bytes from this line.
|
||||
return data;
|
||||
|
||||
#Empty string by default.
|
||||
return "";
|
||||
return b'';
|
||||
|
||||
def passwordfromfile(self,filename):
|
||||
"""Returns the password from an ihex file, for unlocking."""
|
||||
f=open(filename,'r');
|
||||
lines=f.readlines();
|
||||
password="";
|
||||
password=b'';
|
||||
for l in lines:
|
||||
password+=self.handlepasswordline(l);
|
||||
print(password);
|
||||
print(len(password));
|
||||
return password;
|
||||
|
||||
def coredump(bsl):
|
||||
|
Loading…
Reference in New Issue
Block a user