From 11e74dc1d26a3c5e44b9d520b3f7b9441d2e9488 Mon Sep 17 00:00:00 2001 From: Plom Heller Date: Wed, 22 Jul 2026 01:13:45 +0200 Subject: [PATCH] For design raw output, only show non-default parameters. --- bricksplom.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/bricksplom.py b/bricksplom.py index dd08f5d..21264f2 100755 --- a/bricksplom.py +++ b/bricksplom.py @@ -357,14 +357,16 @@ class BrickDesign(Textfiled, Lookupable): def raw( self ) -> str: - return ( - f'{self.id_indented()} ' - + (f'{CHAR_DESIGN_ALT}{self.alternate_to.id_}' if self.alternate_to - else ('|'.join( - [f'{k}{CHAR_ATTR_EQ}{getattr(self, k)}' - for k in BrickDesignData.__annotations__ - if k != 'description']) - + f'{SEP_DESIGN_DESC}{self.description}'))) + raw = f'{self.id_indented()} ' + if self.alternate_to: + return f'{raw}{CHAR_DESIGN_ALT}{self.alternate_to.id_}' + attrs = [] + for attr_key in [k for k in BrickDesignData.__annotations__ + if k != 'description']: + attr_val = getattr(self, attr_key) + if attr_val != getattr(BrickDesignData, attr_key): + attrs += [f'{attr_key}{CHAR_ATTR_EQ}{attr_val}'] + return f'{raw}{"|".join(attrs)}{SEP_DESIGN_DESC}{self.description}' class Brick(Textfiled, WithDb, Lookupable): -- 2.30.2