From 635660579cde7f02dc72d095b0661da567bb201d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 21 Nov 2009 02:12:04 -0500 Subject: server.py now wants a query string --- python/server.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'python') diff --git a/python/server.py b/python/server.py index 8ce99912..541f4541 100644 --- a/python/server.py +++ b/python/server.py @@ -70,20 +70,18 @@ templateDef = '''#encoding utf-8 - #for $xact in $journal - #for $post in $xact + #for $post in $posts #set $total = $total + $post.amount - - $xact.date - $xact.payee + + $post.xact.date + $post.xact.payee $post.account ${strip($post.amount)} ${strip($total)} - #set $last_xact = $xact - #end for + #set $last_xact = $post.xact #end for @@ -120,7 +118,7 @@ class LedgerHandler(BaseHTTPRequestHandler): tmpl = Template(templateDef, filter=UnicodeFilter) tmpl.title = 'Ledger Journal' - tmpl.journal = self.journal + tmpl.posts = self.journal.collect(sys.argv[2]) tmpl.total = ledger.Value(0) tmpl.strip = strip tmpl.last_xact = None @@ -192,7 +190,7 @@ def main(*args): server.socket.close() if __name__ == '__main__': - if len(sys.argv) < 2: - print "usage: server.py " + if len(sys.argv) < 3: + print "usage: server.py " sys.exit(1) main() -- cgit v1.2.3