X-Git-Url: https://plomlompom.com/repos/?p=misc;a=blobdiff_plain;f=ledger.py;fp=ledger.py;h=a26ca0f345f5dfdaf02eb8cff45330991eb14d7d;hp=aa295d28203d7279137d9b143b5c236e98c92e31;hb=13a15b95ade73f4455db648b70e1de784c515039;hpb=8822ee7e3069193162469438bb54ee4629e1ae19 diff --git a/ledger.py b/ledger.py index aa295d2..a26ca0f 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 = """ #