summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-14 06:25:29 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-14 06:25:29 -0400
commit061e19e302fb62eaafbd2029671bdd46dd4d7814 (patch)
tree081700c4302e6efc0f7954dbeaf8d86d4e63e907 /main.py
parent0b0c9b5bd13b1dedf100b137e3a35be60d3d3a27 (diff)
downloadfork-ledger-061e19e302fb62eaafbd2029671bdd46dd4d7814.tar.gz
fork-ledger-061e19e302fb62eaafbd2029671bdd46dd4d7814.tar.bz2
fork-ledger-061e19e302fb62eaafbd2029671bdd46dd4d7814.zip
make config_t visible to Python; almost possible to implement main.cc in main.py
Diffstat (limited to 'main.py')
-rw-r--r--main.py14
1 files changed, 8 insertions, 6 deletions
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):