From: paul Date: Wed, 12 Jan 2011 23:32:05 +0000 (+0000) Subject: fixed some typos and type errors X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=HEAD;p=tabnote fixed some typos and type errors svn path=/trunk/; revision=8 --- diff --git a/tabserver b/tabserver index 2d0c305..a557283 100644 --- a/tabserver +++ b/tabserver @@ -2,20 +2,10 @@ #encoding: utf-8 import pysqlite2.dbapi2 as dbapi -import SimpleXMLRPCServer.CGIXMLRPCRequestHandler as rpcHandler +import SimpleXMLRPCServer sql = None -rpc = rpcHandler() -rpc.register_function(quickIndex) -rpc.register_function(setRecord) -rpc.register_function(getRecord) -rpc.register_function(delRecord) -initDB() -rpc.handle_request() -closeDB() - - def initDB(): sql = dbapi.connect('noteDB.sqlite').cursor() @@ -26,7 +16,7 @@ def initDB(): 'content TEXT, revision DATETIME, UNIQE (uuid));') except: pass -def closeDB() +def closeDB(): db = sql.connection sql.close() db.commit() @@ -67,11 +57,11 @@ def getRecord(uuid): uuid = escape(uuid) sql.execute('SELECT uuid, seq, label, content, revision FROM notes WHERE uuid = "' + uuid + '";') - - - - - - - - +rpc = SimpleXMLRPCServer.CGIXMLRPCRequestHandler() +rpc.register_function(quickIndex) +rpc.register_function(setRecord) +rpc.register_function(getRecord) +rpc.register_function(delRecord) +initDB() +rpc.handle_request() +closeDB()