From 91e8378f04d33137f8e6281928ae70af12be3b2b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 10 Nov 2009 14:16:40 -0500 Subject: Fixes to Python importing; removed "hello" precommand --- python/hello.py | 7 ------- python/server.py | 5 ++++- 2 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 python/hello.py (limited to 'python') diff --git a/python/hello.py b/python/hello.py deleted file mode 100644 index b5b072bb..00000000 --- a/python/hello.py +++ /dev/null @@ -1,7 +0,0 @@ -import ledger - -def precmd_hello(): - hello = ledger.Value() - hello.set_string("Well, hello yourself! This is Ledger, coming to you from Python Land.") - print hello - return hello diff --git a/python/server.py b/python/server.py index 64a91ca3..3c6ddb91 100644 --- a/python/server.py +++ b/python/server.py @@ -20,7 +20,7 @@ class LedgerHandler(BaseHTTPRequestHandler): except Exception: print "Saw exception in POST handler" -def cmd_server(): +def main(*args): try: port = 9000 server = HTTPServer(('', port), LedgerHandler) @@ -31,3 +31,6 @@ def cmd_server(): print "Shutting down server" server.socket.close() +print __name__ +if __name__ == '__main__': + main() -- cgit v1.2.3