本文整理汇总了Python中anki.sync.SyncClient.deck方法的典型用法代码示例。如果您正苦于以下问题:Python SyncClient.deck方法的具体用法?Python SyncClient.deck怎么用?Python SyncClient.deck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anki.sync.SyncClient
的用法示例。
在下文中一共展示了SyncClient.deck方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from anki.sync import SyncClient [as 别名]
# 或者: from anki.sync.SyncClient import deck [as 别名]
time.sleep(0.2)
if self.clobberChoice == "cancel":
self.deck.close()
if not deck:
# alert we're finished early
self.emit(SIGNAL("syncFinished"))
return
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)
# reopen the deck in case we have sources
self.deck = DeckStorage.Deck(path)
client.deck = self.deck
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)
# finished. save deck, preserving mod time
self.setStatus(_("Sync complete."))