本文整理汇总了Python中notifier.Notifier.hideNotification方法的典型用法代码示例。如果您正苦于以下问题:Python Notifier.hideNotification方法的具体用法?Python Notifier.hideNotification怎么用?Python Notifier.hideNotification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notifier.Notifier
的用法示例。
在下文中一共展示了Notifier.hideNotification方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: WAEventHandler
# 需要导入模块: from notifier import Notifier [as 别名]
# 或者: from notifier.Notifier import hideNotification [as 别名]
#.........这里部分代码省略.........
elif reason == "network":
self.sleeping.emit()
#@@TODO ADD reason another connection
def networkDisconnected(self):
self.state = 0
#self.interfaceHandler.call("disconnect")
'''if self.connMonitor.isOnline():
self.networkAvailable()
return
'''
self.sleeping.emit();
#thread.start_new_thread(self.conn.changeState, (0,))
#self.conn.disconnect();
if not self.disconnectRequested:
self.disconnectRequested = True
thread.start_new_thread(lambda: self.interfaceHandler.call("disconnect", ("network",)), ())
self._d("NET SLEEPING")
def networkUnavailable(self):
self.disconnected.emit();
self.interfaceHandler.call("disconnect")
self._d("NET UNAVAILABLE");
def onUnavailable(self):
self._d("SEND UNAVAILABLE")
self.interfaceHandler.call("presence_sendUnavailable")
def conversationOpened(self,jid):
self.notifier.hideNotification(jid);
def onAvailable(self):
if self.state == 2:
self.interfaceHandler.call("presence_sendAvailable")
def sendMessage(self,jid,msg_text):
msg_text = self.strip(msg_text);
self._d("sending message now")
fmsg = WAXMPP.message_store.createMessage(jid);
if fmsg.Conversation.type == "group":
contact = WAXMPP.message_store.store.Contact.getOrCreateContactByJid(self.conn.jid)
fmsg.setContact(contact);
msg_text = msg_text.replace(""","\"")
msg_text = msg_text.replace("&", "&");
msg_text = msg_text.replace("<", "<");
msg_text = msg_text.replace(">", ">");
msg_text = msg_text.replace("<br />", "\n");
fmsg.setData({"status":0,"content":msg_text.encode('utf-8'),"type":1})
WAXMPP.message_store.pushMessage(jid,fmsg)
msgId = self.interfaceHandler.call("message_send", (jid, msg_text.encode('utf-8')))
fmsg.key = Key(jid, True, msgId).toString()
fmsg.save()
#self.conn.sendMessageWithBody(fmsg);
def sendLocation(self, jid, latitude, longitude, rotate):
示例2: WAEventHandler
# 需要导入模块: from notifier import Notifier [as 别名]
# 或者: from notifier.Notifier import hideNotification [as 别名]
#.........这里部分代码省略.........
self.updater.updateAvailable.connect(self.updateAvailable)
self.connecting.emit();
#thread.start_new_thread(self.conn.changeState, (2,))
self.conn.changeState(2);
self.updater.run()
#self.conn.disconnect()
def networkDisconnected(self):
self.sleeping.emit();
self.conn.changeState(0);
#thread.start_new_thread(self.conn.changeState, (0,))
#self.conn.disconnect();
self._d("NET SLEEPING")
def networkUnavailable(self):
self.disconnected.emit();
self._d("NET UNAVAILABLE");
def onUnavailable(self):
self._d("SEND UNAVAILABLE")
self.conn.sendUnavailable();
def conversationOpened(self,jid):
self.notifier.hideNotification(jid);
def onAvailable(self):
self.conn.sendAvailable();
def send_message(self,to_id,msg_text):
fmsg = WAXMPP.message_store.createMessage(to_id);
if fmsg.Conversation.type == "group":
contact = WAXMPP.message_store.store.Contact.getOrCreateContactByJid(self.conn.jid)
fmsg.setContact(contact);
fmsg.setData({"status":0,"content":msg_text.encode('utf-8'),"type":1})
WAXMPP.message_store.pushMessage(to_id,fmsg)
self.conn.sendMessageWithBody(fmsg);
def notificationClicked(self,jid):
self._d("SHOW UI for "+jid)
self.showUI.emit(jid);
def message_received(self,fmsg,duplicate = False):
msg_type = "duplicate" if duplicate else "new";
if fmsg.content is not None:
#self.new_message.emit({"data":fmsg.content,"user_id":fmsg.getContact().jid})
msg_contact = fmsg.getContact();
try:
msg_contact = WAXMPP.message_store.store.getCachedContacts()[msg_contact.number];
示例3: WAEventHandler
# 需要导入模块: from notifier import Notifier [as 别名]
# 或者: from notifier.Notifier import hideNotification [as 别名]
#.........这里部分代码省略.........
self.updater.updateAvailable.connect(self.updateAvailable)
self.connecting.emit();
#thread.start_new_thread(self.conn.changeState, (2,))
self.conn.changeState(2);
self.updater.run()
#self.conn.disconnect()
def networkDisconnected(self):
self.sleeping.emit();
self.conn.changeState(0);
#thread.start_new_thread(self.conn.changeState, (0,))
#self.conn.disconnect();
print "NET SLEEPING"
def networkUnavailable(self):
self.disconnected.emit();
print "NET UNAVAILABLE";
def onUnavailable(self):
print "SEND UNAVAILABLE"
self.conn.sendUnavailable();
def conversationOpened(self,jid):
self.notifier.hideNotification(jid);
def onAvailable(self):
self.conn.sendAvailable();
def send_message(self,to_id,msg_text):
fmsg = WAXMPP.message_store.store.Message.create();
conversation = WAXMPP.message_store.getOrCreateConversationByJid(to_id);
fmsg.setData({"status":0,"content":msg_text.encode('utf-8'),"conversation_id":conversation.id,"type":1})
WAXMPP.message_store.pushMessage(fmsg)
self.conn.sendMessageWithBody(fmsg);
def notificationClicked(self,jid):
print "SHOW UI for "+jid
self.showUI.emit(jid);
def message_received(self,fmsg,duplicate = False):
msg_type = "duplicate" if duplicate else "new";
if fmsg.content is not None:
#self.new_message.emit({"data":fmsg.content,"user_id":fmsg.getContact().jid})
try:
msg_contact = WAXMPP.message_store.store.getCachedContacts()[fmsg.getContact().number];
except:
msg_contact = WAXMPP.message_store.store.Contact.create()
msg_contact.name= fmsg.getContact().number
msg_contact.picture = WAConstants.DEFAULT_CONTACT_PICTURE
msg_contact.jid = eval(fmsg.key.toString()).remote_jid
self.notifier.newMessage(msg_contact.jid, msg_contact.name, fmsg.content,None if type(msg_contact.picture) == str else str(msg_contact.picture.path()),callback = self.notificationClicked);