From: Christian Heller Date: Sun, 27 Apr 2025 17:14:31 +0000 (+0200) Subject: Minor formatting fixes. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/%7B%7Bprefix%7D%7D/todos?a=commitdiff_plain;h=0f0ca3b71dcedf38728818b14f1ed93ce9ced113;p=ledgplom Minor formatting fixes. --- diff --git a/src/ledgplom/ledger.py b/src/ledgplom/ledger.py index 0b94d2f..1587fd7 100644 --- a/src/ledgplom/ledger.py +++ b/src/ledgplom/ledger.py @@ -132,7 +132,9 @@ class _DatLine: @property def raw(self) -> str: """Return as how to be written in .dat file's text content.""" - return self.code + ' ; '.join([''] + [s for s in [self.comment] if s]) + comment_part = ' ; '.join([''] + [s for s in [self.comment] if s]) + code_part = f'{self.code} ' if self.code else '' + return f'{code_part}{comment_part.lstrip()}' def copy(self) -> Self: """Create new instance copying the fields named in .to_copy."""