Translating...

This commit is contained in:
danogentili 2016-06-28 17:49:51 +02:00
parent ddd92f5b30
commit 8d6632036c
2 changed files with 3 additions and 1 deletions

BIN
TL.php

Binary file not shown.

4
TL.py
View File

@ -117,7 +117,6 @@ def deserialize(bytes_io, type_=None, subtype=None):
"""
:type bytes_io: io.BytesIO object
"""
print type_
assert isinstance(bytes_io, io.BytesIO)
# Built-in bare types
if type_ == 'int': x = struct.unpack('<i', bytes_io.read(4))[0]
@ -137,6 +136,7 @@ def deserialize(bytes_io, type_=None, subtype=None):
else:
# We have a short string
x = bytes_io.read(l)
print(-(l+1))
bytes_io.read(-(l+1) % 4) # skip padding bytes
assert isinstance(x, bytes)
elif type_ == 'vector':
@ -151,6 +151,8 @@ def deserialize(bytes_io, type_=None, subtype=None):
except KeyError:
# Boxed types
i = struct.unpack('<i', bytes_io.read(4))[0] # read type ID
print type_
print i
try:
tl_elem = tl.constructor_id[i]
except KeyError: