mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-17 18:46:40 +00:00

A TLObject class has been added, as well as a method for tokenizen .tl files. A TLObject can be created by simply calling `TLObject.from_tl(tl_line)`, this will tokenize the .tl line and return a new TLObject with all the required properties extracted. Also added another method to load .tl files and yield TLObjects, including a SourceBuilder that can be later used to generate Python code.
9 lines
175 B
Python
9 lines
175 B
Python
from parser.tl_parser import TLParser
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
parser = TLParser()
|
|
for tlobject in parser.parse_file('parser/scheme.tl'):
|
|
print(tlobject)
|