Skip to content

Commit

Permalink
Fix long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
ThanatosGit committed Apr 7, 2024
1 parent a107223 commit 2e5972b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/mercury_engine_data_structures/common_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ def _build(self, obj: construct.Container, stream, context, path):
self.value_type._build(value, stream, context, field_path)

def _emitparse(self, code):
return f"Container(({self.key_type._compileparse(code)}, {self.value_type._compileparse(code)}) for i in range({self.count_type._compileparse(code)}))"
return (
f"Container(({self.key_type._compileparse(code)}, {self.value_type._compileparse(code)}) "
f"for i in range({self.count_type._compileparse(code)}))"
)

def _emitbuild(self, code):
fname = f"build_dict_{code.allocateId()}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ def _insert_cond(self, code: construct.CodeGen):
return f"linkedinstances[{id(self.condfunc)}](this)"

def _emitparse(self, code):
return f"(({self.thensubcon._compileparse(code)}) if ({self._insert_cond(code)}) else ({self.elsesubcon._compileparse(code)}))"
return (
f"(({self.thensubcon._compileparse(code)}) if ({self._insert_cond(code)}) "
f"else ({self.elsesubcon._compileparse(code)}))"
)

def _emitbuild(self, code):
return (f"(({self.thensubcon._compilebuild(code)}) if ("
Expand Down
5 changes: 4 additions & 1 deletion tools/create_class_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ def export_code(self):

for type_name in sorted(self._types_with_pointer):
if type_name != "base::reflection::CTypedValue":
code += f'{self.pointer_to_type(type_name)}.add_option("{type_name}", {self.ensure_exported_type(type_name)})\n'
code += (
f'{self.pointer_to_type(type_name)}.add_option("{type_name}", '
f'{self.ensure_exported_type(type_name)})\n'
)
for child in sorted(self.children_for(type_name)):
code += f'{self.pointer_to_type(type_name)}.add_option("{child}", {self.ensure_exported_type(child)})\n'
code += "\n"
Expand Down
5 changes: 4 additions & 1 deletion tools/ghidra_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,10 @@ def _merge_split_types(final_results: dict[str, typing.Any]):

both_hash = key in hashes and similar[0] in hashes
if both_hash:
print(f"{key} (Hash: {key in dread_data.all_name_to_property_id()}) is similar to {similar[0]} (Hash: {similar[0] in dread_data.all_name_to_property_id()})")
print(
f"{key} (Hash: {key in dread_data.all_name_to_property_id()}) is similar to "
f"{similar[0]} (Hash: {similar[0] in dread_data.all_name_to_property_id()})"
)
elif key in hashes:
wrong_to_correct[similar[0]] = key
elif similar[0] in hashes:
Expand Down

0 comments on commit 2e5972b

Please sign in to comment.