diff options
author | John Wiegley <johnw@newartisans.com> | 2004-09-14 06:36:16 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-09-14 06:36:16 -0400 |
commit | f2162bf7ee556c5d46a3a48a4d93bb892041b067 (patch) | |
tree | e58736a8414328c0a3d0aefcf146dc332b677248 /main.py | |
parent | 061e19e302fb62eaafbd2029671bdd46dd4d7814 (diff) | |
download | fork-ledger-f2162bf7ee556c5d46a3a48a4d93bb892041b067.tar.gz fork-ledger-f2162bf7ee556c5d46a3a48a4d93bb892041b067.tar.bz2 fork-ledger-f2162bf7ee556c5d46a3a48a4d93bb892041b067.zip |
further python integration improvements
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -16,6 +16,9 @@ add_option_handler ("goodbye", ":", goodbye) args = process_arguments (sys.argv[1:]) process_environment (os.environ, "LEDGER_") +if len (args) > 0: + config.process_options (args[0], args[1:]) + text_parser = TextualParser () register_parser (text_parser) @@ -30,14 +33,14 @@ class FormatTransaction (TransactionHandler): def __call__ (self, xact): print self.formatter.format(xact) -def foo(d, val): - return d.xact.amount + val +expr = parse_value_expr ("a*2") + +def foo(x, val): + return x.xact.amount + expr.compute (x) + val handler = FormatTransaction("%D %-20P %N %('foo'{$100})") handler = FilterTransactions (handler, "/Checking/") -expr = parse_value_expr ("a*2") - for entry in journal: for xact in entry: handler (xact) |