summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-14 06:36:16 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-14 06:36:16 -0400
commitf2162bf7ee556c5d46a3a48a4d93bb892041b067 (patch)
treee58736a8414328c0a3d0aefcf146dc332b677248 /main.py
parent061e19e302fb62eaafbd2029671bdd46dd4d7814 (diff)
downloadfork-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.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/main.py b/main.py
index e30e229e..24fdc2b6 100644
--- a/main.py
+++ b/main.py
@@ -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)