本文整理汇总了Python中pync.Notifier.remove方法的典型用法代码示例。如果您正苦于以下问题:Python Notifier.remove方法的具体用法?Python Notifier.remove怎么用?Python Notifier.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pync.Notifier
的用法示例。
在下文中一共展示了Notifier.remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print_all_notifications
# 需要导入模块: from pync import Notifier [as 别名]
# 或者: from pync.Notifier import remove [as 别名]
def print_all_notifications(title, message):
Notifier.remove('SMS_ALERTS')
print "Notification received: {0}: {1}".format(title, message)
number = title.strip('Number::')
number = re.sub('\+1','',number)
number = re.sub('\+27','',number)
try:
contact = get_contact_name(number)
print 'This is the Contact: %s' % (contact)
Notifier.notify(message.strip('Msg::'), title='TXT From: %s' % contact, group='SMS_ALERTS', execute="/Users/adewinter/acode/rmac/rmac/test.py")
save_received(number, message)
except Exception as e:
print e
示例2: expanduser
# 需要导入模块: from pync import Notifier [as 别名]
# 或者: from pync.Notifier import remove [as 别名]
continue
yield line
if __name__ == "__main__":
home = expanduser("~")
#eveLogPathPost = join('Documents', 'EVE', 'logs', 'Gamelogs')
eveLogPathPost = join('Library', 'Preferences', 'EVE Online Preferences', 'p_drive', 'My Documents', 'EVE')
eveLogs = join(home, eveLogPathPost)
files = sorted([f for f in listdir(eveLogs)])
newest = files[-1]
rdyLog = join(eveLogs, newest)
logfile = open(rdyLog)
loglines = watchFile(logfile)
for line in loglines:
try:
message = line
Notifier.notify(message)
except (KeyboardInterrupt, SystemExit):
logfile.close()
Notifier.remove(os.getpid())
exit()
raise
except:
logfile.close()
Notifier.remove(os.getpid())
exit()
else:
pass
logfile.close()
Notifier.remove(os.getpid())