本文整理汇总了Python中backend.Backend._get_message方法的典型用法代码示例。如果您正苦于以下问题:Python Backend._get_message方法的具体用法?Python Backend._get_message怎么用?Python Backend._get_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backend.Backend
的用法示例。
在下文中一共展示了Backend._get_message方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _message
# 需要导入模块: from backend import Backend [as 别名]
# 或者: from backend.Backend import _get_message [as 别名]
#.........这里部分代码省略.........
send_btn.show()
close_btn.show()
btns.show()
innerWin.activate()
def __init__(self):
self.backend = Backend()
def __to_html(self, msg):
msg = msg.replace("\n", "<br>")
msg = msg.replace("\r", "")
msg = msg.replace("<br/>", "<br>")
return msg
def _change_mode(self, mode, *args, **kwargs):
if self.mode == mode:
return
self.mode = mode
self._mainList_populate()
def _show_messages(self, email_list, *args, **kwargs):
innerWin = elementary.InnerWindow(self.win)
innerMainBox = elementary.Box(innerWin)
innerMainBox.size_hint_weight_set(1.0, 1.0)
innerMainBox.size_hint_align_set(-1.0, -1.0)
innerScroller = elementary.Scroller(innerWin)
innerScroller.bounce_set(0, 1)
innerScroller.size_hint_weight_set(1.0, 1.0)
innerScroller.size_hint_align_set(-1.0, -1.0)
innerBox = elementary.Box(innerWin)
innerBox.size_hint_weight_set(1.0, 1.0)
innerBox.size_hint_align_set(-1.0, -1.0)
for i in email_list:
msg = self.backend._get_message(i)
b = elementary.Bubble(innerBox)
b.size_hint_weight_set(1.0, 0.0)
b.size_hint_align_set(-1.0, -1.0)
mittente = msg["from"] if not msg["from"].find("<") else msg["from"][: msg["from"].find("<")]
b.label_set("%s [%s]" % (mittente, msg["short_date"]))
text = elementary.AnchorBlock(self.innerWin)
text.text_set(self.__to_html(msg["text"]))
text.size_hint_weight_set(1.0, 0.0)
text.size_hint_align_set(-1.0, -1.0)
b.content_set(text)
b.show()
innerBox.pack_end(b)
innerScroller.content_set(innerBox)
innerScroller.show()
innerBox.show()
innerMainBox.pack_end(innerScroller)
btns_box = elementary.Box(innerWin)
btns_box.horizontal_set(True)
btns_box.homogenous_set(True)
btns_box.size_hint_align_set(-1.0, -1.0)
cls_btn = elementary.Button(innerWin)
def inwin_close(*args, **kwarks):
innerWin.hide()
cls_btn.size_hint_weight_set(1.0, 1.0)
cls_btn.size_hint_align_set(-1.0, -1.0)
cls_btn.label_set(_("Close"))
cls_btn._callback_add("clicked", inwin_close)
cls_btn.show()
reply_btn = elementary.Button(innerWin)