Rename generated layer variable to uppercase readonly property

This commit is contained in:
Lonami Exo
2017-09-17 16:17:55 +02:00
parent c84e54b647
commit aea10b103b
2 changed files with 9 additions and 8 deletions

View File

@@ -83,9 +83,10 @@ class TLGenerator:
builder.writeln('from . import types, functions')
builder.writeln()
# Create a variable to indicate which layer this is
builder.writeln('layer = {} # Current generated layer'.format(
TLParser.find_layer(scheme_file)))
# Create a read-only property to indicate which layer this is
builder.writeln('LAYER = property(fget=lambda: {})'.format(
TLParser.find_layer(scheme_file))
)
builder.writeln()
# Then create the dictionary containing constructor_id: class