rclkar/python3: small simplifications
This commit is contained in:
parent
d9afcdf8a3
commit
b8fa3005dd
@ -43,14 +43,12 @@ htmltemplate = '''
|
|||||||
</html>
|
</html>
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
nlbytes = b'\n'
|
||||||
|
bsbytes = b'\\'
|
||||||
PY3 = sys.version > '3'
|
PY3 = sys.version > '3'
|
||||||
if PY3:
|
if PY3:
|
||||||
nlbytes = bytes('\n', encoding='iso-8859-1')
|
|
||||||
bsbytes = bytes('\\', encoding='iso-8859-1')
|
|
||||||
nullchar = 0
|
nullchar = 0
|
||||||
else:
|
else:
|
||||||
nlbytes = '\n'
|
|
||||||
bsbytes = '\\'
|
|
||||||
nullchar = chr(0)
|
nullchar = chr(0)
|
||||||
|
|
||||||
class KarTextExtractor:
|
class KarTextExtractor:
|
||||||
|
|||||||
@ -39,8 +39,7 @@ if PY3:
|
|||||||
def next_byte_as_int(data):
|
def next_byte_as_int(data):
|
||||||
return next(data)
|
return next(data)
|
||||||
def next_byte_as_char(data):
|
def next_byte_as_char(data):
|
||||||
ret = bytes([next(data)])
|
return bytes([next(data)])
|
||||||
return ret
|
|
||||||
else:
|
else:
|
||||||
def next_byte_as_int(data):
|
def next_byte_as_int(data):
|
||||||
return ord(data.next())
|
return ord(data.next())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user