def storeEntry(self, modul, entry):
if not entry:
return
id = entry["id"]
k = Key(encoded=id)
if k.kind() != modul:
raise ValueError("Invalid key! Key's kind should be %s, is %s" % (modul,k.kind()))
if k.app() != self.getAppId():
raise ValueError("Invalid key! Key's app should be %s, is %s" % (self.getAppId(),k.app()))
try:
t = {}
for k,v in entry.items():
if isinstance(v,unicode):
v = v.encode("UTF-8")
t[k] = v
self.ns.request("/dbtransfer/storeEntry", {"e":pickle.dumps(t).encode("HEX"),"key":self.importKey})
except:
print("------")
print( entry )
raise
评论列表
文章目录