def notify_process ():
    global notifications, notifying, last_notify

    if len(notifications) == 0:
        return;

#    if notifying == True:
#        #See Bug #622021 on gnome
#        diff = datetime.now() - last_notify
#        if diff.seconds > 30:
#            logger.debug("30 seconds from the last notification, reactivating")
#            notifying = False
#        else:
#            return

    if not Notify.is_initted():
        logger.warn('The notification library has not been initialized yet')
        return

    while len(notifications) > 0:
        n = notifications.pop(0)
        #n.connect("closed", notify_closed_cb)
        n.show()

    notifying= True
    last_notify = datetime.now()
    #TODO Do it better and configuable
    sound = Sound()
    sound.play(config.add_data_prefix("drip.ogg"))
def notify_process():
    global notifications, notifying, last_notify

    if len(notifications) == 0:
        return


#    if notifying == True:
#        #See Bug #622021 on gnome
#        diff = datetime.now() - last_notify
#        if diff.seconds > 30:
#            logger.debug("30 seconds from the last notification, reactivating")
#            notifying = False
#        else:
#            return

    if not Notify.is_initted():
        logger.warn('The notification library has not been initialized yet')
        return

    while len(notifications) > 0:
        n = notifications.pop(0)
        #n.connect("closed", notify_closed_cb)
        n.show()

    notifying = True
    last_notify = datetime.now()
    #TODO Do it better and configuable
    sound = Sound()
    sound.play(config.add_data_prefix("drip.ogg"))
def notify_process ():
    global notifications, notifying, last_notify

    if len(notifications) == 0:
        return;

    if notifying == True:
        #See Bug #622021 on gnome
        diff = datetime.now() - last_notify
        if diff.seconds > 30:
            logger.debug("30 seconds from the last notification, reactivating")
            notifying = False
        else:
            return

    n = notifications[0]
    n.connect("closed", notify_closed_cb)
    n.show()

    notifying= True
    last_notify = datetime.now()
    #TODO Do it better and configuable
    sound = Sound()
    sound.play(config.add_data_prefix("drip.ogg"))
Пример #4
0
def notify_process():
    global notifications, notifying, last_notify

    if len(notifications) == 0:
        return

    if notifying == True:
        #See Bug #622021 on gnome
        diff = datetime.now() - last_notify
        if diff.seconds > 30:
            logger.debug("30 seconds from the last notification, reactivating")
            notifying = False
        else:
            return

    n = notifications[0]
    n.connect("closed", notify_closed_cb)
    n.show()

    notifying = True
    last_notify = datetime.now()
    #TODO Do it better and configuable
    sound = Sound()
    sound.play(config.add_data_prefix("drip.ogg"))