summaryrefslogtreecommitdiff
path: root/python/server.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/server.py')
-rw-r--r--python/server.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python/server.py b/python/server.py
index 9aa9c518..8ce99912 100644
--- a/python/server.py
+++ b/python/server.py
@@ -108,7 +108,7 @@ templateDef = '''#encoding utf-8
class LedgerHandler(BaseHTTPRequestHandler):
def __init__(self, *args):
- self.journal = ledger.Journal('/Users/johnw/src/ledger/doc/sample.dat')
+ self.journal = ledger.Journal(sys.argv[1])
BaseHTTPRequestHandler.__init__(self, *args)
def do_GET(self):
@@ -191,6 +191,8 @@ def main(*args):
print "Shutting down server"
server.socket.close()
-print __name__
if __name__ == '__main__':
+ if len(sys.argv) < 2:
+ print "usage: server.py <DATA-FILE>"
+ sys.exit(1)
main()