Fix line too long (pylint)

This commit is contained in:
ChillerDragon 2023-03-29 16:23:11 +02:00
parent b39f067222
commit d21092f44b

View file

@ -132,7 +132,8 @@ def generate_msg(msg: NetMessageJson, game: str) -> None:
if member['type']['kind'] == 'string': # TODO: sanitize cc
ftype = 'str'
default = "'default'"
elif member['type']['kind'] in ('raw', 'sha256', 'rest', 'data'): # TODO: data has a size field
elif member['type']['kind'] in \
('raw', 'sha256', 'rest', 'data'): # TODO: data has a size field
ftype = 'bytes'
default = "b'\\x00'"
# {"name": ["mode"], "type": {"kind": "enum", "enum": ["chat"]}},
@ -178,7 +179,8 @@ def generate_msg(msg: NetMessageJson, game: str) -> None:
ftype = 'int'
if member['type']['kind'] == 'string':
ftype = 'str'
elif member['type']['kind'] in ('raw', 'sha256', 'rest', 'data'): # TODO: data has a size field
elif member['type']['kind'] in \
('raw', 'sha256', 'rest', 'data'): # TODO: data has a size field
ftype = 'bytes'
# {"name": ["mode"], "type": {"kind": "enum", "enum": ["chat"]}},
elif member['type']['kind'] == 'enum':
@ -213,7 +215,8 @@ def generate_msg(msg: NetMessageJson, game: str) -> None:
unpacker = 'int()'
if member['type']['kind'] == 'string': # TODO: sanitize cc
unpacker = 'str()'
elif member['type']['kind'] in ('raw', 'sha256', 'rest', 'data'): # TODO: data has a size field
elif member['type']['kind'] in \
('raw', 'sha256', 'rest', 'data'): # TODO: data has a size field
unpacker = 'raw()'
# {"name": ["mode"], "type": {"kind": "enum", "enum": ["chat"]}},
elif member['type']['kind'] == 'enum':
@ -247,7 +250,8 @@ def get_dependencies(msg: NetMessageJson) -> str:
for member in msg['members']:
if member['type']['kind'] == 'string': # TODO: sanitize cc
packer_deps.append('pack_str')
elif member['type']['kind'] in ('raw', 'sha256', 'rest', 'data'): # TODO: data has a size field
elif member['type']['kind'] in \
('raw', 'sha256', 'rest', 'data'): # TODO: data has a size field
pass
# {"name": ["mode"], "type": {"kind": "enum", "enum": ["chat"]}},
elif member['type']['kind'] == 'enum':
@ -279,7 +283,8 @@ def pack_field(member: NetMessageMemberJson) -> str:
packer = 'int'
if member['type']['kind'] == 'string': # TODO: sanitize cc
packer = 'str'
elif member['type']['kind'] in ('raw', 'sha256', 'rest', 'data'): # TODO: data has a size field
elif member['type']['kind'] in \
('raw', 'sha256', 'rest', 'data'): # TODO: data has a size field
return f'self.{name}'
# {"name": ["mode"], "type": {"kind": "enum", "enum": ["chat"]}},
elif member['type']['kind'] == 'enum':