Detect current MTProtoLayer automatically

This commit is contained in:
Lonami
2016-09-17 21:09:20 +02:00
parent 51a531225f
commit 6642f73a3d
5 changed files with 19 additions and 7 deletions

View File

@@ -167,6 +167,10 @@ class TLGenerator:
builder.writeln('import {}'.format(TLGenerator.get_full_file_name(tlobject)))
builder.writeln()
# Create a variable to indicate which layer this is
builder.writeln('layer = {} # Current generated layer'.format(TLParser.find_layer(scheme_file)))
builder.writeln()
# Then create the dictionary containing constructor_id: class
builder.writeln('tlobjects = {')
builder.current_indent += 1