fix for slots

This commit is contained in:
əlemi 2021-11-29 14:17:11 +01:00
parent b20a2c751b
commit 8ac1cbfd6a

View file

@ -105,7 +105,7 @@ class PacketClassWriter:
name=self.title, name=self.title,
ids='{\n\t\t' + ',\n\t\t'.join(self.ids) + '\n\t}\n', ids='{\n\t\t' + ',\n\t\t'.join(self.ids) + '\n\t}\n',
definitions='{\n\t\t' + '\n\t\t'.join(self.slots) + '\n\t}\n', definitions='{\n\t\t' + '\n\t\t'.join(self.slots) + '\n\t}\n',
slots=', '.join(f"'{x}'" for x in (list(self.attrs) + ["id"])), # TODO de-jank! slots=', '.join((f"'is_{x}'" if keyword.iskeyword(x) else f"'{x}'") for x in (list(self.attrs) + ["id"])), # TODO de-jank!
fields='\n\t'.join(self.fields), fields='\n\t'.join(self.fields),
state=self.state, state=self.state,
) )