Permalink
Browse files

Main function of the application.

  • Loading branch information...
1 parent efb19c6 commit aed23716529879b2a7c71be643e727a991ef7cc2 Apostolos Bessas committed Apr 7, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 receipts/main.py
View
20 receipts/main.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+
+import sys
+import receipts.settings
+import receipts.db
+from receipts.core_types import Receipt
+from receipts.cmd_ui import setup_parser, add_receipt, report_month
+
+
+def main(argv=None):
+ if argv is None:
+ argv = sys.argv[1:]
+ parser = setup_parser()
+ args = parser.parse_args(argv)
+ args.func(**vars(args))
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main())

0 comments on commit aed2371

Please sign in to comment.