svn path=/trunk/; revision=8
#encoding: utf-8
import pysqlite2.dbapi2 as dbapi
#encoding: utf-8
import pysqlite2.dbapi2 as dbapi
-import SimpleXMLRPCServer.CGIXMLRPCRequestHandler as rpcHandler
+import SimpleXMLRPCServer
-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()
def initDB():
sql = dbapi.connect('noteDB.sqlite').cursor()
'content TEXT, revision DATETIME, UNIQE (uuid));')
except: pass
'content TEXT, revision DATETIME, UNIQE (uuid));')
except: pass
db = sql.connection
sql.close()
db.commit()
db = sql.connection
sql.close()
db.commit()
uuid = escape(uuid)
sql.execute('SELECT uuid, seq, label, content, revision FROM notes WHERE uuid = "' + 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()