#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()
'content TEXT, revision DATETIME, UNIQE (uuid));')
except: pass
-def closeDB()
+def closeDB():
db = sql.connection
sql.close()
db.commit()
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()