home · contact · privacy
Minor formatting fixes.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 27 Apr 2025 17:14:31 +0000 (19:14 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 27 Apr 2025 17:14:31 +0000 (19:14 +0200)
src/ledgplom/ledger.py

index 0b94d2f139268f51cb2279d3caabc17141b58c8b..1587fd7fa8af9a321cca2ca2e24b5b951f474001 100644 (file)
@@ -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."""