X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/copy_structured?a=blobdiff_plain;f=ledger.py;h=46035bc3790ac42815fd1b9c2a1910cf574da07e;hb=28bd91c52ce1eab2b26793097e0d9cabc3c33c64;hp=aa295d28203d7279137d9b143b5c236e98c92e31;hpb=8822ee7e3069193162469438bb54ee4629e1ae19;p=misc diff --git a/ledger.py b/ledger.py index aa295d2..46035bc 100755 --- a/ledger.py +++ b/ledger.py @@ -15,6 +15,21 @@ class EditableException(PlomException): super().__init__(*args, **kwargs) +class LedgerTextLine: + + def __init__(self, text_line): + self.text_line = text_line + self.comment = '' + split_by_comment = text_line.rstrip().split(sep=';', maxsplit=1) + self.non_comment = split_by_comment[0].rstrip() + self.empty = len(split_by_comment) == 1 and len(self.non_comment) == 0 + if self.empty: + return + if len(split_by_comment) == 2: + self.comment = split_by_comment[1].lstrip() + + + # html_head = """ #