当前位置: 首页>>代码示例>>Python>>正文


Python SyncClient.prepareFullSync方法代码示例

本文整理汇总了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()
开发者ID:TianYuanChu,项目名称:AnkiCPRP,代码行数:33,代码来源:sync.py


注:本文中的anki.sync.SyncClient.prepareFullSync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。