From 0fffddd327544d4e86991d5c2ba0421150ab8af9 Mon Sep 17 00:00:00 2001 From: Plom Heller Date: Sun, 9 Aug 2026 05:51:30 +0200 Subject: [PATCH] Remove dead code. --- src/bricksplom/misc.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/bricksplom/misc.py b/src/bricksplom/misc.py index 19a65b4..becb8ce 100644 --- a/src/bricksplom/misc.py +++ b/src/bricksplom/misc.py @@ -108,7 +108,7 @@ class WithDb: def __init__( self, - db: Optional['BricksDb'] = None, + db: 'BricksDb', **kwargs ) -> None: self.db = db @@ -326,14 +326,12 @@ class BrickDesign(Textfiled, WithDb, Lookupable): if not item.ldraw: return 'no LDRAW file associated' lines: list[str] = [] - assert item.db is not None walk(lines, item.ldraw, item.db.ldraw.tree(item.ldraw)) return CHAR_NEWLINE.join(lines) def to_boxes( item: Self ) -> str: - assert item.db is not None brick_ids = tuple(b.id_ for b in item.db.bricks.values() if b.design_id in item.all_ids) boxes = set() @@ -499,7 +497,6 @@ class Brick(Textfiled, WithDb, Lookupable): def __str__( self ) -> str: - assert self.db design = self.db.designs[self.design_id] color = str(self.db.colors[self.color_id]).strip() comment = f' # {self.comment}' if self.comment else '' @@ -616,7 +613,6 @@ class BrickSet(Textfiled, WithDb, Lookupable): self ) -> str: def format_line(count, brick_id, comment) -> str: - assert self.db brick = self.db.bricks[brick_id] design_id = brick.design_id tail_comment = f' # {comment}' if comment else '' @@ -663,7 +659,6 @@ class Box(WithDb, Lookupable): **kwargs ) -> None: super().__init__(**kwargs) - assert self.db self.id_ = id_ self._set = bricks_set designed_listings: list[tuple[BrickDesign, list[BrickListing]]] = [] @@ -693,7 +688,6 @@ class Box(WithDb, Lookupable): def show( self, ) -> str: - assert self.db lines = [] for design, listings in self.designs_to_listings: lines += [ -- 2.30.2