本文整理汇总了Python中anki.sync.SyncClient.prepareFullSync方法的典型用法代码示例。如果您正苦于以下问题:Python SyncClient.prepareFullSync方法的具体用法?Python SyncClient.prepareFullSync怎么用?Python SyncClient.prepareFullSync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anki.sync.SyncClient
的用法示例。
在下文中一共展示了SyncClient.prepareFullSync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from anki.sync import SyncClient [as 别名]
# 或者: from anki.sync.SyncClient import prepareFullSync [as 别名]
else:
self.conflictResolution = "keepLocal"
changes = True
# summary
if not self.conflictResolution and not self.onlyMerge:
self.setStatus(_("Fetching summary from server..."), 0)
sums = client.summaries()
if (self.conflictResolution or
self.onlyMerge or client.needFullSync(sums)):
self.setStatus(_("Preparing full sync..."), 0)
if self.conflictResolution == "keepLocal":
client.remoteTime = 0
elif self.conflictResolution == "keepRemote" or self.onlyMerge:
client.localTime = 0
lastSync = self.deck.lastSync
ret = client.prepareFullSync()
if ret[0] == "fromLocal":
if not self.conflictResolution:
if lastSync <= 0 and not deckCreated:
self.clobberChoice = None
self.emit(SIGNAL("syncClobber"), syncName)
while not self.clobberChoice:
time.sleep(0.2)
if self.clobberChoice == "cancel":
# disable syncing on this deck
c = sqlite.connect(sqlpath)
c.execute(
"update decks set syncName = null, "
"lastSync = 0")
c.commit()
c.close()