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
No related merge requests found
......@@ -108,7 +108,8 @@ class LegoAssembly:
if self.get_root_assembly().contains_uuid(component.uuid):
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}."
)
component.parent = self
......@@ -128,8 +129,8 @@ class LegoAssembly:
if self.get_root_assembly().contains_uuid(assembly.uuid):
raise AssertionError(
f"This assembly or a subassembly already contains the assembly with ID "
f"{assembly.uuid}."
f"This assembly or a subassembly already contains "
f"the assembly with ID {assembly.uuid}."
)
assembly.parent = self
self.assemblies.append(assembly)
......@@ -146,8 +147,9 @@ class LegoAssembly:
self.add(p)
else:
raise TypeError(
f"Argument should be of types {LegoAssembly.__name__}, {LegoComponent.__name__} or a list of them, "
f"got {type(part).__name__} instead."
f"Argument should be of types {LegoAssembly.__name__}, "
f"{LegoComponent.__name__} or a list of them. "
f"Got {type(part).__name__} instead."
)
def children(self) -> Dict[str, List[LegoComponent] | List[LegoAssembly]]:
......@@ -198,9 +200,9 @@ class LegoAssembly:
def clone(self, label: Optional[str] = None) -> LegoAssembly:
if label is None:
label = self.properties['label']
label = self.properties["label"]
clone = LegoAssembly(self.layer, None, self.properties)
clone.properties['label'] = label
clone.properties["label"] = label
for component in self.components:
clone.add_component(component.clone())
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