本文整理汇总了Python中backend.Backend.sync_stepbystep_init方法的典型用法代码示例。如果您正苦于以下问题:Python Backend.sync_stepbystep_init方法的具体用法?Python Backend.sync_stepbystep_init怎么用?Python Backend.sync_stepbystep_init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backend.Backend
的用法示例。
在下文中一共展示了Backend.sync_stepbystep_init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _message
# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import sync_stepbystep_init [as 别名]
#.........这里部分代码省略.........
if filter == "author":
messages = self.backend._get_list(order_by="author")
authors = messages.keys()
authors.sort()
for author in authors:
email_list = []
for message in messages[author]:
email_list.append(message["id"])
self.mainList.item_append(author, None, None, partial(self._show_messages, email_list))
elif filter == "thread":
messages = self.backend._get_list(order_by="thread")
threads = messages.keys()
threads.sort()
for thread in threads:
email_list = []
for message in messages[thread]:
email_list.append(message["id"])
self.mainList.item_append(thread, None, None, partial(self._show_messages, email_list))
else:
for message in self.backend._get_list(order_by=""):
self.mainList.item_append(
"[%s] %s" % (message["from"], message["subject"]),
None,
None,
partial(self._show_messages, (message["id"],)),
)
self.mainList.go()
def sync(self, *args, **kwargs):
self._message(_("Checking your inbox for new emails.."))
ecore.timer_add(0.1, self.sync_init)
def sync_init(self, *args, **kawargs):
self.backend.sync_stepbystep_init()
if self.backend.syncronizing:
self.sync_nextstep()
self._message()
def sync_nextstep(self, *args, **kwargs):
if self.backend.syncronizing:
status = self.backend.sync_next()
self._message(
"%s<br><br><br>%s <a href=''>%s</a> %s <a href=''>%s</a>"
% (_("Sync"), _("Emails retrieved:"), status[0], _("of"), status[1])
)
ecore.timer_add(0.1, self.sync_nextstep)
else:
self._mainList_populate()
self._message()
def quit(self, obj, event, data):
elementary.exit()
def initUi(self):
self.win = elementary.Window(self.win_title, elementary.ELM_WIN_BASIC)
self.win.title_set(self.win_title)
self.win.callback_destroy_add(self.quit, None, None)
##
self.innerWin = elementary.InnerWindow(self.win)
self.innerWin.size_hint_weight_set(1.0, 1.0)
self.innerWin.size_hint_align_set(-1.0, -1.0)
self.innerWinAnchor = elementary.AnchorView(self.innerWin)
##
self.bg = elementary.Background(self.win)
self.bg.size_hint_weight_set(1.0, 1.0)
##