本文整理汇总了Python中anki.sync.SyncClient.fullSyncFromServer方法的典型用法代码示例。如果您正苦于以下问题:Python SyncClient.fullSyncFromServer方法的具体用法?Python SyncClient.fullSyncFromServer怎么用?Python SyncClient.fullSyncFromServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anki.sync.SyncClient
的用法示例。
在下文中一共展示了SyncClient.fullSyncFromServer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from anki.sync import SyncClient [as 别名]
# 或者: from anki.sync.SyncClient import fullSyncFromServer [as 别名]
# disable syncing on this deck
c = sqlite.connect(sqlpath)
c.execute(
"update decks set syncName = null, "
"lastSync = 0")
c.commit()
c.close()
if not deck:
# alert we're finished early
self.emit(SIGNAL("syncFinished"))
return True
self.setStatus(_("Uploading..."), 0)
client.fullSyncFromLocal(ret[1], ret[2])
else:
self.setStatus(_("Downloading..."), 0)
client.fullSyncFromServer(ret[1], ret[2])
self.setStatus(_("Sync complete."), 0)
else:
# diff
self.setStatus(_("Determining differences..."), 0)
payload = client.genPayload(sums)
# send payload
if not deck:
pr = client.payloadChangeReport(payload)
self.setStatus("<br>" + pr + "<br>", 0)
self.setStatus(_("Transferring payload..."), 0)
res = client.server.applyPayload(payload)
# apply reply
self.setStatus(_("Applying reply..."), 0)
client.applyPayloadReply(res)
# now that both sides have successfully applied, tell