summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-10 20:08:07 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-10 20:08:07 -0400
commitff4589caae7b5bd40350eac605916d085b5106cc (patch)
tree6a7b67074fc314adb6d961a9347d8face512b11b /main.py
parent435b9ed7794958626a66b2490a7ec67033508eaa (diff)
downloadfork-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.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/main.py b/main.py
index 1e25b7ed..cad0e6e8 100644
--- a/main.py
+++ b/main.py
@@ -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)