From 061e19e302fb62eaafbd2029671bdd46dd4d7814 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 14 Sep 2004 06:25:29 -0400 Subject: make config_t visible to Python; almost possible to implement main.cc in main.py --- main.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index 7427961d..e30e229e 100644 --- a/main.py +++ b/main.py @@ -9,16 +9,18 @@ def hello (str): def goodbye (str): print "Goodbye:", str -register_option ("hello", "h:", hello) -register_option ("goodbye", "g:", goodbye) +add_config_option_handlers () +add_option_handler ("hello", ":", hello) +add_option_handler ("goodbye", ":", goodbye) + args = process_arguments (sys.argv[1:]) -process_environment (os.environ, "TEST_") +process_environment (os.environ, "LEDGER_") -parser = TextualParser () -register_parser (parser) +text_parser = TextualParser () +register_parser (text_parser) journal = Journal () -parse_journal_file (args[0], journal) +print parse_journal_file (args[0], journal), "entries" class FormatTransaction (TransactionHandler): def __init__ (self, fmt): -- cgit v1.2.3