Skip to content
Snippets Groups Projects
Commit 765fbbcd authored by Hock, Martin's avatar Hock, Martin
Browse files

Format changes to adhere pep8 / flake8 (with black compatible 88 line length)

parent e9d7aaaa
No related branches found
No related tags found
1 merge request!3Merge to main to create "WS2223" Version
Pipeline #929103 failed
...@@ -108,7 +108,8 @@ class LegoAssembly: ...@@ -108,7 +108,8 @@ class LegoAssembly:
if self.get_root_assembly().contains_uuid(component.uuid): if self.get_root_assembly().contains_uuid(component.uuid):
raise AssertionError( raise AssertionError(
f"This assembly or a subassembly already contains the component with ID " f"This assembly or a subassembly already contains "
f"the component with ID "
f"{component.uuid}." f"{component.uuid}."
) )
component.parent = self component.parent = self
...@@ -128,8 +129,8 @@ class LegoAssembly: ...@@ -128,8 +129,8 @@ class LegoAssembly:
if self.get_root_assembly().contains_uuid(assembly.uuid): if self.get_root_assembly().contains_uuid(assembly.uuid):
raise AssertionError( raise AssertionError(
f"This assembly or a subassembly already contains the assembly with ID " f"This assembly or a subassembly already contains "
f"{assembly.uuid}." f"the assembly with ID {assembly.uuid}."
) )
assembly.parent = self assembly.parent = self
self.assemblies.append(assembly) self.assemblies.append(assembly)
...@@ -146,8 +147,9 @@ class LegoAssembly: ...@@ -146,8 +147,9 @@ class LegoAssembly:
self.add(p) self.add(p)
else: else:
raise TypeError( raise TypeError(
f"Argument should be of types {LegoAssembly.__name__}, {LegoComponent.__name__} or a list of them, " f"Argument should be of types {LegoAssembly.__name__}, "
f"got {type(part).__name__} instead." f"{LegoComponent.__name__} or a list of them. "
f"Got {type(part).__name__} instead."
) )
def children(self) -> Dict[str, List[LegoComponent] | List[LegoAssembly]]: def children(self) -> Dict[str, List[LegoComponent] | List[LegoAssembly]]:
...@@ -198,9 +200,9 @@ class LegoAssembly: ...@@ -198,9 +200,9 @@ class LegoAssembly:
def clone(self, label: Optional[str] = None) -> LegoAssembly: def clone(self, label: Optional[str] = None) -> LegoAssembly:
if label is None: if label is None:
label = self.properties['label'] label = self.properties["label"]
clone = LegoAssembly(self.layer, None, self.properties) clone = LegoAssembly(self.layer, None, self.properties)
clone.properties['label'] = label clone.properties["label"] = label
for component in self.components: for component in self.components:
clone.add_component(component.clone()) clone.add_component(component.clone())
for assembly in self.assemblies: for assembly in self.assemblies:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment