Beispiel #1
0
    args = args.split(None, 1)
    if (len(args) == 0):
        title="Test"
    else:
        title=args[0]
  
    if (len(args) <= 1):
        text="Pięćdziesiąt trzy"
    else:
        text = args[1]
  
    return displayNotify(title, text, TIMEOUT_MSG, ekg.config["notify:icon_msg"])

ekg.handler_bind('protocol-status', notifyStatus)
ekg.handler_bind("protocol-message-received", notifyMessage)
ekg.variable_add("notify:ignore_sessions_regexp", "^irc:")
ekg.variable_add("notify:ignore_uids_regexp", "^xmpp:.*@conference\.")
ekg.variable_add("notify:urgency_critical_regexp", "^$")
ekg.variable_add("notify:urgency_normal_regexp", "^$")
ekg.variable_add("notify:icon_status", "dialog-warning")
ekg.variable_add("notify:icon_msg", "dialog-warning")
ekg.variable_add("notify:message_timeout", "3500", timeCheck)
ekg.variable_add("notify:message_notify", "1")
ekg.variable_add("notify:message_notify_unknown", "1")
ekg.variable_add("notify:show_timestamps", "1")
ekg.variable_add("notify:status_timeout", "3500", timeCheck)
ekg.variable_add("notify:status_notify", "1")
ekg.variable_add("notify:catch_url", "1")
ekg.variable_add("notify:catch_url_timeout", "5000", timeCheck)
ekg.command_bind("notify:send", notifyTest)
Beispiel #2
0
def messageHandler(session, uid, type, text, stime, ignore_level):
	for c in command:
		mx = command[c][0].search(text)
		if (mx):
			ekg.command(("/msg %s %s" % (uid, command[c][1](mx))).encode('UTF8'))
			break

def testMessageHandler(session, uid, type, text, stime, ignore_level):
	if text[-21:-4] == "!jirabot selftest":
		for i in color.test():
			ekg.command("/msg %s TEST [%s]" % (uid, i))

ekg.handler_bind("protocol-message-received", messageHandler)
ekg.handler_bind("protocol-message-received", testMessageHandler)
ekg.timer_bind(5, handleSignals)

ekg.variable_add("jirabot:url", "")
ekg.variable_add("jirabot:username", "")
ekg.variable_add("jirabot:password", "")
ekg.variable_add("jirabot:project", "")
ekg.variable_add("jirabot:channel", "")
ekg.variable_add("jirabot:sigdir", "/nonexistent")
ekg.variable_add("jirabot:projectregexp", "[A-Z]+")

ekg.command_bind("jirabot:initialize", initialize)
ekg.command_bind("jirabot:print_config", print_config)
ekg.command_bind("jirabot:signal", lambda n, a: messageHandler(None, ekg.config["jirabot:channel"], None, a, None, None))

initialize(None, None)
Beispiel #3
0
# -*- coding: utf-8 -*-

"""
Simple (remote) notification plugin for ekg2.

"""

import os
import re

import ekg

# The path to fifo
home_dir = os.getenv('HOME')
fifo_dir = '%s/notify' % home_dir
ekg.variable_add('notify:fifo', fifo_dir)

# Sessions that should be tracked, separated by whitespace
ekg.variable_add('notify:sessions', '')

# Words that should be treaded as highlighted
# during MUCs (Multi User Chats), whitespace-separated.
# Only highlighted messages will be sent as notification.
ekg.variable_add('notify:highlights', '')

class Notify(object):
    """
    Handles sending notifications.

    :ivar ekgconfig: ekg2's config (ekg.config)
    :type ekgconfig: :class:`dict`
Beispiel #4
0
	    ekg.echo('£adnie to tak ircowaæ w pracy? ;)')
    sesja = ekg.session_get(session)
    if sesja.connected():
	ekg.echo('Po³±czony!')
    else:
	ekg.echo('W tym miejscu jeszcze nie po³±czony')
    ekg.echo('Lista userów sesji: '+", ".join(sesja.users()))

def keypress(key):
    ekg.echo('nacisnales #'+ str(key));
    

def disconnect_handler(session):
    ekg.echo("£o, sesja %s nam pad³a" % (session,))
    ekg.echo("Wysy³amy smsa ¿e nam cu¶ pad³o...")

def foo_command(name, args):
    ekg.echo("Wywo³ane polecenie foo!")

def varchange(name, newval):
    ekg.echo("Zmienna %s zmieni³a warto¶æ na %s" % (name, newval) )
    
ekg.command_bind('foo', foo_command)
ekg.handler_bind('protocol-message-received', message_handler)
ekg.handler_bind('protocol-message-sent', own_message_handler)
ekg.handler_bind('protocol-status', status_handler)
ekg.handler_bind('protocol-connected', connect_handler)
ekg.handler_bind('protocol-disconnected', disconnect_handler)
ekg.handler_bind('ui-keypress', keypress)
ekg.variable_add('zmienna_testowa', 'warto¶æ', varchange)
Beispiel #5
0
    else:
        ekg.echo('W tym miejscu jeszcze nie po³±czony')
    ekg.echo('Lista userów sesji: ' + ", ".join(sesja.users()))


def keypress(key):
    ekg.echo('nacisnales #' + str(key))


def disconnect_handler(session):
    ekg.echo("£o, sesja %s nam pad³a" % (session, ))
    ekg.echo("Wysy³amy smsa ¿e nam cu¶ pad³o...")


def foo_command(name, args):
    ekg.echo("Wywo³ane polecenie foo!")


def varchange(name, newval):
    ekg.echo("Zmienna %s zmieni³a warto¶æ na %s" % (name, newval))


ekg.command_bind('foo', foo_command)
ekg.handler_bind('protocol-message-received', message_handler)
ekg.handler_bind('protocol-message-sent', own_message_handler)
ekg.handler_bind('protocol-status', status_handler)
ekg.handler_bind('protocol-connected', connect_handler)
ekg.handler_bind('protocol-disconnected', disconnect_handler)
ekg.handler_bind('ui-keypress', keypress)
ekg.variable_add('zmienna_testowa', 'warto¶æ', varchange)
Beispiel #6
0
        if(timeend != "all"):
            if timeforall:
                if int(hourend) < int(time.hour):
                    continue
                if int(hourend) == int(time.hour) and int(minuteend) < int(time.minute):
                    continue
            else:
                if yearend < tmpdate.year:
                    continue
                if yearend == tmpdate.year and monthend < tmpdate.month:
                    continue
                if yearend == tmpdate.year and monthend == tmpdate.month and dayend < tmpdate.day:
                    continue
                if yearend == tmpdate.year and monthend == tmpdate.month and dayend == tmpdate.day and int(hourend) < int(time.hour):
                    continue
                if yearend == tmpdate.year and monthend == tmpdate.month and dayend == tmpdate.day and int(hourend) == int(time.hour) and int(minuteend) < int(time.minute):
                    continue
        if(search or search2):
            if not s.findall(body):
                continue
        if(tmpdate != pdate):
            strtoprint += cmagenta + str(tmpdate) + "\n"
            pdate = tmpdate
        strtoprint += cblue + "    " + str(time) + cgreen + " " + who + cwhite + " " + body[1:] + "\n"
    ekg.echo(strtoprint)


ekg.command_bind('logsearch', search)
ekg.command_bind('logsearch:help', help)
ekg.variable_add('logsearch:logdir_path', os.environ["HOME"] + "/.ekg2/logs/")