home · contact · privacy
Resolve pylint warnings. master
authorPlom Heller <plom@plomlompom.com>
Thu, 30 Apr 2026 01:35:43 +0000 (03:35 +0200)
committerPlom Heller <plom@plomlompom.com>
Thu, 30 Apr 2026 01:35:43 +0000 (03:35 +0200)
bricksplom.py

index dafe49104495fbb8613cde7da622878dbde5727b..6a8fc7314684f0d8ea884eef1cf73487f0c21b29 100755 (executable)
@@ -426,15 +426,16 @@ def check_consistencies_between_tables(
     for coll in collections.values():
         if coll.is_in is None:
             continue
-        direction = 1 if coll.is_in else (-1)
         for count, piece_id, _ in coll.piece_listings_flat():
-            counts[piece_id] = counts.get(piece_id, 0) + (direction * count)
+            counts[piece_id] = (counts.get(piece_id, 0)
+                                + ((1 if coll.is_in else (-1)) * count))
     for piece_id, count in counts.items():
         assert count == 0, (piece_id, count)
 
 
 def main(
         ) -> None:
+    'Load tables from BRICKSPLOM_DIR and put out in reproducible listings.'
     dir_tables = environ.get(NAME_ENV_DIRNAME, '.')
     colors = Color.from_textfile((dir_tables, PATH_COLORS))
     pieces = Piece.from_textfile((dir_tables, PATH_PIECES))