diff options
author | John Wiegley <johnw@newartisans.com> | 2004-09-10 20:08:07 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-09-10 20:08:07 -0400 |
commit | ff4589caae7b5bd40350eac605916d085b5106cc (patch) | |
tree | 6a7b67074fc314adb6d961a9347d8face512b11b /main.py | |
parent | 435b9ed7794958626a66b2490a7ec67033508eaa (diff) | |
download | fork-ledger-ff4589caae7b5bd40350eac605916d085b5106cc.tar.gz fork-ledger-ff4589caae7b5bd40350eac605916d085b5106cc.tar.bz2 fork-ledger-ff4589caae7b5bd40350eac605916d085b5106cc.zip |
added support for ValueExpr objects to python.
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -20,16 +20,19 @@ register_parser (parser) journal = Journal () parse_journal_file (args[0], journal) -class OutputTransaction (TransactionHandler): - def __init__ (self): - self.formatter = Format ("%D %-20P %N") +class FormatTransaction (TransactionHandler): + def __init__ (self, fmt): + self.formatter = Format (fmt) TransactionHandler.__init__ (self) + def __call__ (self, xact): print self.formatter.format(xact) -handler = OutputTransaction() +handler = FormatTransaction("%D %-20P %N") handler = FilterTransactions (handler, "/Checking/") +expr = parse_value_expr ("a*2") + for entry in journal: for xact in entry: handler (xact) |