From d21092f44b9b3891709d264934607877ea69d1c0 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Wed, 29 Mar 2023 16:23:11 +0200 Subject: [PATCH] Fix line too long (pylint) --- scripts/generate_messages.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/generate_messages.py b/scripts/generate_messages.py index 8c08860..b356ef1 100755 --- a/scripts/generate_messages.py +++ b/scripts/generate_messages.py @@ -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':