dbusjab.py 文件源码

python
阅读 15 收藏 0 点赞 0 评论 0

项目:IceCash2 作者: redeyser 项目源码 文件源码
def check_ding(account, sender, message, conv, flags):
    sender = sender.encode('utf-8')
    message = message.encode('utf-8')
    obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
    purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
    title = purple.PurpleConversationGetTitle(conv).encode('utf-8')
    if not title:
        title = conv
    if len(dingregex.findall(message)) > 0:
        pass
        #pynotify.init("Basics")
        #notify = pynotify.Notification("DING DING DING","{} called for DING DING DING in {}".format(sender,title),"emblem-danger")
        #notify.set_timeout(pynotify.EXPIRES_NEVER)
        #notify.show()

    if DEBUG:
        print "sender: {} message: {}, account: {}, conversation: {}, flags: {}, title: {}".format(sender,message,account,conv,flags,title)
    f=open("_","w")
    f.write(message)
    f.close()
    os.system("echo '%s' | python _sendFAX.py localhost 10111 Star +bw" % sender)
    os.system("cat _ | python _sendFAX.py localhost 10111 Star -")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号