本文整理汇总了Python中amsn2.core.views.StringView.append_text方法的典型用法代码示例。如果您正苦于以下问题:Python StringView.append_text方法的具体用法?Python StringView.append_text怎么用?Python StringView.append_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类amsn2.core.views.StringView
的用法示例。
在下文中一共展示了StringView.append_text方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __on_chat_send
# 需要导入模块: from amsn2.core.views import StringView [as 别名]
# 或者: from amsn2.core.views.StringView import append_text [as 别名]
def __on_chat_send(self, entry, event_keyval, event_keymod):
if (event_keyval == gtk.keysyms.Return):
buffer = entry.get_buffer()
start, end = buffer.get_bounds()
msg = buffer.get_text(start, end)
entry.clear()
entry.grab_focus()
if (msg == ''): return False
color = self.button_color.get_color()
hex8 = "%.2x%.2x%.2x" % ((color.red/0x101), (color.green/0x101), (color.blue/0x101))
style = papyon.TextFormat.NO_EFFECT
if self.button_bold.get_active(): style |= papyon.TextFormat.BOLD
if self.button_italic.get_active(): style |= papyon.TextFormat.ITALIC
if self.button_underline.get_active(): style |= papyon.TextFormat.UNDERLINE
if self.button_strikethrough.get_active(): style |= papyon.TextFormat.STRIKETHROUGH
font_name = self.button_font.get_font_name()
font_family = pango.FontDescription(font_name).get_family()
format = papyon.TextFormat(font=font_family, color=hex8, style=style)
strv = StringView()
strv.append_text(msg)
self._amsn_conversation.send_message(strv, format)
elif event_keyval == gtk.keysyms.Escape:
self._parent.destroy()
示例2: __sendMessage
# 需要导入模块: from amsn2.core.views import StringView [as 别名]
# 或者: from amsn2.core.views.StringView import append_text [as 别名]
def __sendMessage(self):
# TODO: Switch to this when implemented
""" msg = self.ui.inputWidget.toHtml()
self.ui.inputWidget.clear()
strv = StringView()
strv.appendElementsFromHtml(msg) """
msg = QString.fromUtf8(self.ui.inputWidget.toPlainText())
self.ui.inputWidget.clear()
strv = StringView()
strv.append_text(str(msg))
## as we send our msg to the conversation:
self._amsn_conversation.send_message(strv)
示例3: __sendMsg
# 需要导入模块: from amsn2.core.views import StringView [as 别名]
# 或者: from amsn2.core.views.StringView import append_text [as 别名]
def __sendMsg(self, msg):
bb = elementary.Bubble(self.parent)
bb.label_set("TODO: MYSELF")
bb.info_set("TODO: TIMESTAMP")
#TODO: bb.icon_set()
bb.size_hint_weight_set(evas.EVAS_HINT_EXPAND, 0.0)
bb.size_hint_align_set(evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL)
ab = elementary.AnchorBlock(self.parent)
ab.text_set(msg)
bb.content_set(ab)
ab.show()
self.outbx.pack_end(bb)
bb.show()
strv = StringView()
strv.append_text(msg)
self._amsn_conversation.send_message(strv)
示例4: __sendMessage
# 需要导入模块: from amsn2.core.views import StringView [as 别名]
# 或者: from amsn2.core.views.StringView import append_text [as 别名]
def __sendMessage(self):
# TODO: Switch to this when implemented
""" msg = self.ui.inputWidget.toHtml()
self.ui.inputWidget.clear()
strv = StringView()
strv.appendElementsFromHtml(msg) """
msg = QString.fromUtf8(self.ui.inputWidget.toPlainText())
self.ui.inputWidget.clear()
color = self.color
hex8 = "%.2x%.2x%.2x" % ((color.red()), (color.green()), (color.blue()))
style = papyon.TextFormat.NO_EFFECT
info = QFontInfo(self.font)
if info.bold(): style |= papyon.TextFormat.BOLD
if info.italic(): style |= papyon.TextFormat.ITALIC
if self.font.underline(): style |= papyon.TextFormat.UNDERLINE
if self.font.strikeOut(): style |= papyon.TextFormat.STRIKETHROUGH
font_family = str(info.family())
format = papyon.TextFormat(font=font_family, color=hex8, style=style)
strv = StringView()
strv.append_text(str(msg))
## as we send our msg to the conversation:
self._amsn_conversation.send_message(strv, format)
示例5: send_message
# 需要导入模块: from amsn2.core.views import StringView [as 别名]
# 或者: from amsn2.core.views.StringView import append_text [as 别名]
def send_message(self, uid, msg):
if uid == self._uid:
stmess = StringView()
stmess.append_text('\n'.join(msg))
self._conversation.send_message(stmess)
return True
示例6: __psmChange
# 需要导入模块: from amsn2.core.views import StringView [as 别名]
# 或者: from amsn2.core.views.StringView import append_text [as 别名]
def __psmChange(self):
sv = StringView()
sv.append_text(str(self.ui.statusMessage.toPlainText()))
self._myview.psm = sv
示例7: __nickChange
# 需要导入模块: from amsn2.core.views import StringView [as 别名]
# 或者: from amsn2.core.views.StringView import append_text [as 别名]
def __nickChange(self):
sv = StringView()
sv.append_text(str(self.ui.nickName.toPlainText()))
self._myview.nick = sv