From ab0a602f9f1b79f913f587d253b389afc517982d Mon Sep 17 00:00:00 2001 From: Esteban Dugueperoux <43169544+EstebanDugueperoux2@users.noreply.github.com> Date: Sat, 4 Oct 2025 15:59:42 +0200 Subject: [PATCH] black: Format incorrectly formated files (#7194) --- nix/build-all.py | 2 +- .../bonsai/bim/module/drawing/svgwriter.py | 4 ++-- src/bonsai/bonsai/tool/drawing.py | 17 ++++++++--------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/nix/build-all.py b/nix/build-all.py index e30e3322fa..a8f4cb7db9 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -345,7 +345,7 @@ if any(f.startswith("py-") for f in flags): PYTHON_VERSIONS = [pyv for pyv in PYTHON_VERSIONS if f"py-{''.join(pyv.split('.')[:2])}" in flags] if any(f.startswith("occt-") for f in flags): - OCCT_VERSION = next(f.split('-', 1)[1] for f in flags if f.startswith("occt-")) + OCCT_VERSION = next(f.split("-", 1)[1] for f in flags if f.startswith("occt-")) print(OCCT_VERSION) diff --git a/src/bonsai/bonsai/bim/module/drawing/svgwriter.py b/src/bonsai/bonsai/bim/module/drawing/svgwriter.py index 67c2a19384..18900be5e5 100644 --- a/src/bonsai/bonsai/bim/module/drawing/svgwriter.py +++ b/src/bonsai/bonsai/bim/module/drawing/svgwriter.py @@ -839,12 +839,12 @@ class SvgWriter: symbol = tool.Drawing.get_annotation_symbol(element) newline_at = tool.Drawing.get_newline_at(element) - + # Get reverse_list and list_separator from EPset_Annotation pset_data = ifcopenshell.util.element.get_pset(element, "EPset_Annotation") or {} reverse_list = pset_data.get("Reverse_List", False) list_separator = pset_data.get("List_Separator") or ", " - + template_text_fields = [] if symbol: symbol_transform = self.get_symbol_transform(text_position_svg_str, angle, text_obj) diff --git a/src/bonsai/bonsai/tool/drawing.py b/src/bonsai/bonsai/tool/drawing.py index 5a01923103..7a93bc10bf 100644 --- a/src/bonsai/bonsai/tool/drawing.py +++ b/src/bonsai/bonsai/tool/drawing.py @@ -1242,12 +1242,12 @@ class Drawing(bonsai.core.tool.Drawing): props = cls.get_text_props(obj) element = tool.Ifc.get_entity(obj) assert element - + ifc_file = tool.Ifc.get() pset = tool.Pset.get_element_pset(element, "EPset_Annotation") if not pset: pset = ifcopenshell.api.pset.add_pset(ifc_file, product=element, name="EPset_Annotation") - + ifcopenshell.api.pset.edit_pset( ifc_file, pset=pset, @@ -1259,7 +1259,6 @@ class Drawing(bonsai.core.tool.Drawing): }, ) - # TODO below this point is highly experimental prototype code with no tests class SheetWarningType(NamedTuple): @@ -1841,17 +1840,17 @@ class Drawing(bonsai.core.tool.Drawing): @classmethod def replace_text_literal_variables( - cls, - text: str, - product: Optional[ifcopenshell.entity_instance] = None, + cls, + text: str, + product: Optional[ifcopenshell.entity_instance] = None, reverse_list: bool = False, - list_separator: str = ", " + list_separator: str = ", ", ) -> str: if not product: return text if list_separator: - list_separator = list_separator.encode().decode('unicode_escape') - + list_separator = list_separator.encode().decode("unicode_escape") + for command in re.findall("``.*?``", text): original_command = command for variable in re.findall("{{.*?}}", command):