本文整理汇总了Python中anki.sync.SyncClient.mediaSupported方法的典型用法代码示例。如果您正苦于以下问题:Python SyncClient.mediaSupported方法的具体用法?Python SyncClient.mediaSupported怎么用?Python SyncClient.mediaSupported使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anki.sync.SyncClient
的用法示例。
在下文中一共展示了SyncClient.mediaSupported方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from anki.sync import SyncClient [as 别名]
# 或者: from anki.sync.SyncClient import mediaSupported [as 别名]
start = time.time()
if client.prepareSync():
changes = True
# summary
self.setStatus(_("Fetching summary from server..."), 0)
sums = client.summaries()
if client.needFullSync(sums):
self.setStatus(_("Preparing full sync..."), 0)
ret = client.prepareFullSync()
if ret[0] == "fromLocal":
self.setStatus(_("Uploading..."), 0)
client.fullSyncFromLocal(ret[1], ret[2])
else:
self.setStatus(_("Downloading..."), 0)
client.fullSyncFromServer(ret[1], ret[2])
if client.mediaSupported():
self.doBulkDownload(proxy.deckName)
self.setStatus(_("Sync complete."), 0)
else:
# diff
self.setStatus(_("Determining differences..."), 0)
payload = client.genPayload(sums)
# send payload
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)
if client.mediaSyncPending: