def prof_init(version, status):
    if _score_url:
        prof.register_timed(_get_scores, 60)
        prof.register_command("/cricket", 0, 0,
            "/cricket",
            "Get latest cricket score.",
            "Get latest cricket score.",
            _cmd_cricket)
def prof_init(version, status):
    t = threading.Thread(target=_inc_counter)
    t.daemon = True
    t.start()

    prof.win_create(plugin_win, _handle_win_input)

    synopsis = [
        "/python-test consalert",
        "/python-test consshow <message>",
        "/python-test consshow_t <group> <key> <default> <message>",
        "/python-test constest",
        "/python-test winshow <message>",
        "/python-test winshow_t <group> <key> <default> <message>",
        "/python-test notify <message>",
        "/python-test sendline <line>",
        "/python-test get recipient|room",
        "/python-test log debug|info|warning|error <message>",
        "/python-test count"
    ]
    description = "Python test plugins. All commands focus the plugin window."
    args = [
        [ "consalert",                                      "Highlight the console window in the status bar" ],
        [ "consshow <message>",                             "Show the message in the console window" ],
        [ "consshow_t <group> <key> <default> <message>",   "Show the themed message in the console window. " ],
        [ "constest",                                       "Show whether the command was run in the console." ],
        [ "winshow <message>",                              "Show the message in the plugin window" ],
        [ "winshow_t <group> <key> <default> <message>",    "Show the themed message in the plugin window. " ],
        [ "notify <message>",                               "Send a desktop notification with message" ],
        [ "sendline <line>",                                "Pass line to profanity to process" ],
        [ "get recipient",                                  "Show the current chat recipient, if in a chat window" ],
        [ "get room",                                       "Show the current room JID, if ina a chat room"],
        [ "log debug|info|warning|error <message>",         "Log a message at the specified level" ],
        [ "count",                                          "Show the counter, incremented every 5 seconds by a worker thread" ]
    ]
    examples = [
        "/python-test sendline /about",
        "/python-test log debug \"Test debug message\"",
        "/python-test consshow_t c-test cons.show none \"This is themed\"",
        "/python-test consshow_t none none bold_cyan \"This is bold_cyan\""
    ]

    prof.register_command("/python-test", 1, 5, synopsis, description, args, examples, cmd_pythontest)

    prof.register_ac("/python-test", 
        [ "consalert", "consshow", "consshow_t", "constest", "winshow", "winshow_t", "notify", "sendline", "get", "log", "count" ]
    )
    prof.register_ac("/python-test get",
        [ "recipient", "room" ]
    )
    prof.register_ac("/python-test log",
        [ "debug", "info", "warning", "error" ]
    )

    prof.register_timed(timed_callback, 30)
def prof_init(version, status):
    prof.cons_show("python-test: init, " + version + ", " + status)

    prof.register_command("/python", 0, 1, "/python", "python-test", "python-test", _cmd_python)

    prof.register_command("/upper", 0, 1, "/upper", "Uppercase input string", "Uppercase input string", _cmd_upper)

    prof.register_ac("/pcomplete", [ "aah", "baa", "bee" ])
    prof.register_ac("/pcomplete aah", [ "one", "two", "three", "nan" ])
    prof.register_ac("/pcomplete baa", [ "james", "jim", "jane", "bob" ])
    prof.register_command("/pcomplete", 0, 2, "/pcomplete", "Python completion", "Python completion", _cmd_upper)

    prof.register_timed(_timer_test, 10)
Exemple #4
0
def prof_init(version, status, account_name, fulljid):
    last_state[STATE_SUCCESS] = []
    last_state[STATE_UNSTABLE] = []
    last_state[STATE_FAILURE] = []
    last_state[STATE_QUEUED] = []
    last_state[STATE_RUNNING] = []
    last_state[STATE_NOBUILDS] = []
    last_state[STATE_UNKNOWN] = []

    jenkins_t = threading.Thread(target=_jenkins_poll)
    jenkins_t.daemon = True
    jenkins_t.start()

    prof.register_timed(_prof_callback, prof_cb_interval)
    prof.register_timed(_remind, prof_remind_interval)

    prof.completer_add("/jenkins", [
        "help", "jobs", "failing", "passing", "unstable", "build", "open",
        "log", "remind", "notify", "settings"
    ])
    prof.completer_add("/jenkins remind", ["on", "off"])
    prof.completer_add("/jenkins notify", ["on", "off"])

    synopsis = [
        "/jenkins jobs|failing|passing|unstable", "/jenkins build <job>",
        "/jenkins open <job>", "/jenkins log <job>", "/jenkins remind on|off",
        "/jenkins notify on|off", "/jenkins settings"
    ]
    description = "Monitor, run and view Jenkins jobs."
    args = [["jobs", "List all jobs"], ["failing", "List all failing jobs"],
            ["passing", "List all passing jobs"],
            ["unstable", "List all unstable jobs"],
            ["build <job>", "Trigger build for job"],
            ["open <job>", "Open job in browser"],
            ["log <job>", "Show the latest build log for job"],
            ["remind on|off", "Enable/disable reminder notifications"],
            ["notify on|off", "Enable/disable build notifications"],
            ["settings", "Show current settings"]]
    examples = [
        "/kenkins failing", "/kenkins build stabber-build",
        "/kenkins remind off"
    ]

    prof.register_command("/jenkins", 0, 2, synopsis, description, args,
                          examples, _cmd_jenkins)
Exemple #5
0
def prof_init(version, status):
    last_state[STATE_SUCCESS] = []
    last_state[STATE_UNSTABLE] = []
    last_state[STATE_FAILURE] = []
    last_state[STATE_QUEUED] = []
    last_state[STATE_RUNNING] = []
    last_state[STATE_NOBUILDS] = []
    last_state[STATE_UNKNOWN] = []

    jenkins_t = threading.Thread(target=_jenkins_poll)
    jenkins_t.daemon = True
    jenkins_t.start()

    prof.register_timed(_prof_callback, prof_cb_interval)
    prof.register_timed(_remind, prof_remind_interval)

    prof.register_ac("/jenkins", [
        "help", "jobs", "failing", "passing", "unstable", "build", "open",
        "log", "remind", "notify", "settings"
    ])
    prof.register_ac("/jenkins remind", ["on", "off"])
    prof.register_ac("/jenkins notify", ["on", "off"])
    prof.register_command("/jenkins", 0, 2, "/jenkins", "Do jenkins stuff.",
                          "Do jenkins stuff.", _cmd_jenkins)
Exemple #6
0
def prof_init(version, status, account_name, fulljid):
    last_state[STATE_SUCCESS] = []
    last_state[STATE_UNSTABLE] = []
    last_state[STATE_FAILURE] = []
    last_state[STATE_QUEUED] = []
    last_state[STATE_RUNNING] = []
    last_state[STATE_NOBUILDS] = []
    last_state[STATE_UNKNOWN] = []

    jenkins_t = threading.Thread(target=_jenkins_poll)
    jenkins_t.daemon = True;
    jenkins_t.start()

    prof.register_timed(_prof_callback, prof_cb_interval)
    prof.register_timed(_remind, prof_remind_interval)

    prof.completer_add(
        "/jenkins", [
            "help",
            "jobs",
            "failing",
            "passing",
            "unstable",
            "build",
            "open",
            "log",
            "remind",
            "notify",
            "settings"
        ]
    );
    prof.completer_add(
        "/jenkins remind", [
            "on",
            "off"
        ]
    );
    prof.completer_add(
        "/jenkins notify", [
            "on",
            "off"
        ]
    );

    synopsis = [ 
        "/jenkins jobs|failing|passing|unstable",
        "/jenkins build <job>",
        "/jenkins open <job>",
        "/jenkins log <job>",
        "/jenkins remind on|off",
        "/jenkins notify on|off",
        "/jenkins settings"
    ]
    description = "Monitor, run and view Jenkins jobs."
    args = [
        [ "jobs",           "List all jobs" ],
        [ "failing",        "List all failing jobs" ],
        [ "passing",        "List all passing jobs" ],
        [ "unstable",       "List all unstable jobs" ],
        [ "build <job>",    "Trigger build for job" ],
        [ "open <job>",     "Open job in browser" ],
        [ "log <job>",      "Show the latest build log for job" ],
        [ "remind on|off",  "Enable/disable reminder notifications" ],
        [ "notify on|off",  "Enable/disable build notifications" ],
        [ "settings",       "Show current settings" ]
    ]
    examples = [
        "/kenkins failing",
        "/kenkins build stabber-build",
        "/kenkins remind off"
    ]

    prof.register_command("/jenkins", 0, 2, synopsis, description, args, examples, _cmd_jenkins)
def prof_init(version, status, account_name, fulljid):
    global count
    global ping_id
    global thread_stop

    count = 0
    ping_id = 1

    thread_stop = threading.Event()
    count_thread = threading.Thread(target=_inc_counter)
    count_thread.daemon = True
    count_thread.start()

    prof.disco_add_feature("urn:xmpp:profanity:python_test_plugin")

    prof.win_create(plugin_win, _handle_win_input)
    if account_name and fulljid:
        prof.win_show(
            plugin_win, "fired -> prof_init: " + version + ", " + status +
            ", " + account_name + ", " + fulljid)
    else:
        prof.win_show(plugin_win,
                      "fired -> prof_init: " + version + ", " + status)

    synopsis = [
        "/python-test consalert", "/python-test consshow <message>",
        "/python-test consshow_t <group> <key> <default> <message>",
        "/python-test constest", "/python-test winshow <message>",
        "/python-test winshow_t <group> <key> <default> <message>",
        "/python-test notify <message>", "/python-test sendline <line>",
        "/python-test get recipient|room|nick|occupants",
        "/python-test log debug|info|warning|error <message>",
        "/python-test count", "/python-test ping <jid>",
        "/python-test boolean get <group> <key>",
        "/python-test boolean set <group> <key> <value>",
        "/python-test string get <group> <key>",
        "/python-test string set <group> <key> <value>",
        "/python-test string_list get <group> <key>",
        "/python-test string_list add <group> <key> <value>",
        "/python-test string_list remove <group> <key> <value>",
        "/python-test string_list remove_all <group> <key>",
        "/python-test int get <group> <key>",
        "/python-test int set <group> <key> <value>",
        "/python-test incoming <barejid> <resource> <message>",
        "/python-test completer add|remove <item>", "/python-test file"
    ]
    description = "Python test plugins. All commands focus the plugin window."
    args = [
        ["consalert", "Highlight the console window in the status bar"],
        ["consshow <message>", "Show the message in the console window"],
        [
            "consshow_t <group> <key> <default> <message>",
            "Show the themed message in the console window. "
        ], ["constest", "Show whether the command was run in the console."],
        ["winshow <message>", "Show the message in the plugin window"],
        [
            "winshow_t <group> <key> <default> <message>",
            "Show the themed message in the plugin window. "
        ], ["notify <message>", "Send a desktop notification with message"],
        ["sendline <line>", "Pass line to profanity to process"],
        [
            "get recipient",
            "Show the current chat recipient, if in a chat window"
        ], ["get room", "Show the current room JID, if ina a chat room"],
        ["get nick", "Show nickname in current room, if ina a chat room"],
        [
            "get occupants",
            "Show occupants in current room, if ina a chat room"
        ],
        [
            "log debug|info|warning|error <message>",
            "Log a message at the specified level"
        ],
        [
            "count",
            "Show the counter, incremented every 5 seconds by a worker thread"
        ], ["ping <jid>", "Send an XMPP ping to the specified Jabber ID"],
        ["boolean get <group> <key>", "Get a boolean setting"],
        ["boolean set <group> <key> <value>", "Set a boolean setting"],
        ["string get <group> <key>", "Get a string setting"],
        ["string set <group> <key> <value>", "Set a string setting"],
        ["string_list get <group> <key>", "Get a string list setting"],
        [
            "string_list add <group> <key> <value>",
            "Add a string to a string list setting"
        ],
        [
            "string_list remove <group> <key> <value>",
            "Remove a string from a string list setting"
        ],
        [
            "string_list remove_all <group> <key>",
            "Remove all strings from a string list setting"
        ], ["int get <group> <key>", "Get a integer setting"],
        ["int set <group> <key> <value>", "Set a integer setting"],
        [
            "incoming <barejid> <resource> <message>",
            "Show an incoming message."
        ],
        [
            "completer add <item>",
            "Add an autocomplete item to the /c-test command."
        ],
        [
            "completer remove <item>",
            "Remove an autocomplete item from the /c-test command."
        ], ["file", "Complete a file path."]
    ]
    examples = [
        "/python-test sendline /about",
        "/python-test log debug \"Test debug message\"",
        "/python-test consshow_t c-test cons.show none \"This is themed\"",
        "/python-test consshow_t none none bold_cyan \"This is bold_cyan\"",
        "/python-test ping [email protected]"
    ]

    prof.register_command("/python-test", 1, 5, synopsis, description, args,
                          examples, _cmd_pythontest)

    prof.completer_add("/python-test", [
        "consalert", "consshow", "consshow_t", "constest", "winshow",
        "winshow_t", "notify", "sendline", "get", "log", "count", "ping",
        "boolean", "string", "string_list", "int", "incoming", "completer",
        "file"
    ])
    prof.completer_add("/python-test get",
                       ["recipient", "room", "nick", "occupants"])
    prof.completer_add("/python-test log",
                       ["debug", "info", "warning", "error"])
    prof.completer_add("/python-test boolean", ["get", "set"])
    prof.completer_add("/python-test string", ["get", "set"])
    prof.completer_add("/python-test string_list",
                       ["get", "add", "remove", "remove_all"])
    prof.completer_add("/python-test int", ["get", "set"])
    prof.completer_add("/python-test completer", ["add", "remove"])

    prof.filepath_completer_add("/python-test file")

    prof.register_timed(timed_callback, 5)
def prof_init(version, status):
    if _score_url:
        prof.register_timed(_get_scores, 60)
        prof.register_command("/cricket", 0, 0, "/cricket",
                              "Get latest cricket score.",
                              "Get latest cricket score.", _cmd_cricket)