Beispiel #1
0
def prof_init(version, status, account_name, fulljid):
    synopsis = ["/paste"]
    description = "Paste contents of clipboard."
    args = []
    examples = []
    prof.register_command("/paste", 0, 0, synopsis, description, args,
                          examples, _cmd_paste)
def prof_init(version, status, account_name, fulljid):
    synopsis = [
        "/wikipedia search <text>",
        "/wikipedia summary <title>",
        "/wikipedia page <title>",
        "/wikipedia images <title>",
        "/wikipedia links <title>",
        "/wikipedia refs <title>",
        "/wikipedia open <url>"
    ]
    description = "Interact with wikipedia."
    args = [
        [ "search <text>",  "Search for pages" ],
        [ "summary <title>", "Show summary for page" ],
        [ "page <title>",    "Show the whole page" ],
        [ "images <title>",  "Show images URLs for page" ],
        [ "links <title>",   "Show links to other pages from page" ],
        [ "refs <title>",   "Show external references for page" ],
        [ "open <url>",     "Open the a URL in the browser" ]
    ]
    examples = [
        "/wikipedia search Iron Maiden"
    ]

    prof.register_command("/wikipedia", 2, 2, synopsis, description, args, examples, cmd_wp)

    prof.completer_add("/wikipedia", 
        [ "search", "summary", "page", "images", "links", "refs", "open" ]
    )
Beispiel #3
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [ 
        "/presence_notify all|online|off",
        "/presence_notify ignored add|remove|clear [<barejid>]",
        "/presence_notify resource on|off"
    ]
    description = "Send a desktop notification on presence updates."
    args = [
        [ "all",                            "Enable all presence notifications" ],
        [ "online",                         "Enable only online/offline presence notifications" ],
        [ "off",                            "Disable presence notifications" ],
        [ "ignored add|remove <barejid>",   "Add or remove a contact from the list excluded from presence notifications"],
        [ "ignored clear",                  "Clear the list of excluded contacts"],
        [ "resource on|off",                "Enable/disable showing the contacts resource in the notification"]
    ]
    examples = [
        "/presence_notify all",
        "/presence_notify ignored add [email protected]"
    ]

    prof.register_command("/presence_notify", 0, 3, synopsis, description, args, examples, _cmd_presence_notify)

    prof.completer_add("/presence_notify",
        [ "all", "online", "off", "ignored", "resource" ]
    )
    prof.completer_add("/presence_notify ignored",
        [ "add", "remove", "clear" ]
    )
    prof.completer_add("/presence_notify resource",
        [ "on", "off" ]
    )
Beispiel #4
0
def prof_init(version, status):
    synopsis = [ "/whoami" ]
    description = "Calls the system whoami command"
    args = []
    examples = []

    prof.register_command("/whoami", 0, 0, synopsis, description, args, examples, _cmd_whoami)
Beispiel #5
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [
        "/notifycmd on|off|active", "/notifycmd command <command>",
        "/notifycmd rooms on|off|mention"
    ]
    description = "Executes a command when a message is received"
    args = [
        ["on|off", "Enable/disable notifycmd for all windows"],
        ["active", "Enable notifycmd for active window only"],
        [
            "command <args>",
            "Set command to execute. Replaces %s with sender, %m with message and %% with literal %."
        ],
        [
            "rooms <args>",
            "Setting for multi-user rooms. Set to 'on', 'off' or 'mention'. If set to mention it will only run it your nick was mentioned."
        ]
    ]
    examples = []

    prof.register_command("/notifycmd", 0, 2, synopsis, description, args,
                          examples, _cmd_notifycmd)
    prof.completer_add("/notifycmd",
                       ["on", "off", "active", "command", "rooms"])
    prof.completer_add("/notifycmd rooms", ["on", "off", "mention"])
Beispiel #6
0
def prof_init(version, status):
    prof.register_command("/browser", 0, 1,
        "/browser [url]",
        "View a URL in the browser.",
        "View a URL in the browser, if no argument is supplied, " +
        "the last received URL will be used.",
        _cmd_browser)
Beispiel #7
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [ "/whoami" ]
    description = "Calls the system whoami command"
    args = []
    examples = []

    prof.register_command("/whoami", 0, 0, synopsis, description, args, examples, _cmd_whoami)
Beispiel #8
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [
        "/autocorrector on|off", "/autocorrector showlist",
        "/autocorrector clearall", "/autocorrector add"
        "/autocorrector rm"
    ]
    description = "Messy typist autocorrector. Replaces common typos in your outgoing messages."
    args = [
        ["on|off", "Enable/disable correction for all windows"],
        ["showlist", "show typolist."],
        ["add", "Add entry to typolist. Use pattern:replacement as format."],
        [
            "rm",
            "Remove entry from typolist. Use pattern:replacement as format."
        ], ["clearall", "Remove all entries from typolist"]
    ]
    examples = [
        "/autocorrector on",
        "/autocorrector add tpyo:typo",
        "/autocorrector add tset:test",
        "/autocorrector rm tset:test",
        "/autocorrector showlist",
    ]

    prof.settings_string_set("autocorrector", "enabled", "on")
    prof.register_command("/autocorrector", 0, 2, synopsis, description, args,
                          examples, _cmd_autocorrector)
    prof.completer_add("/autocorrector",
                       ["on", "off", "clearall", "add", "rm", "showlist"])
Beispiel #9
0
def prof_init(version, status, account_name, fulljid):
    synopsis = ["/platform"]
    description = "Output system information to the console window."
    args = []
    examples = []

    prof.register_command("/platform", 0, 0, synopsis, description, args,
                          examples, _cmd_platform)
Beispiel #10
0
def prof_init(version, status, account_name, fulljid):
    synopsis = ["/clients"]
    description = "Show client software used by chat room occupants"
    args = []
    examples = []

    prof.register_command("/clients", 0, 0, synopsis, description, args,
                          examples, _cmd_clients)
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)
Beispiel #12
0
def prof_init(version, status, account_name, fulljid):
    synopsis = ["/ascii <message>"]
    description = "ASCIIfy a message."
    args = [["<message>", "The message to be ASCIIfied"]]
    examples = ["/ascii \"Hello there\""]

    prof.register_command("/ascii", 1, 1, synopsis, description, args,
                          examples, _cmd_ascii)
Beispiel #13
0
def prof_init(version, status, account_name, fulljid):
    synopsis = ["/browser", "/browser <url>"]
    description = "View a URL in the systems default browser. If no argument is supplied, the last URL in the current chat or room will be used. " \
        "Tab autocompletion will go through all previous links in the current chat/room"
    args = [["<url>", "URL to open in the browser"]]
    examples = ["/browser http://www.profanity.im"]

    prof.register_command("/browser", 0, 1, synopsis, description, args,
                          examples, _cmd_browser)
def prof_init(version, status):
    synopsis = [ 
        "/platform"
    ]
    description = "Output system information to the console window."
    args = []
    examples = []

    prof.register_command("/platform", 0, 0, synopsis, description, args, examples, _cmd_platform)
Beispiel #15
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [ 
        "/clients"
    ]
    description = "Show client software used by chat room occupants"
    args = []
    examples = []

    prof.register_command("/clients", 0, 0, synopsis, description, args, examples, _cmd_clients)
Beispiel #16
0
def prof_init(version, status, account_name, fulljid):
    synopsis = ["/chatterbot", "/chatterbot enable|disable"]
    description = "ChatterBot, running with no args will show the current chatterbot status"
    args = [["enable", "Enable chatterbot"], ["disable", "Disable chatterbot"]]
    examples = []

    prof.register_command("/chatterbot", 0, 1, synopsis, description, args,
                          examples, _cmd_chatterbot)
    prof.completer_add("/chatterbot", ["enable", "disable"])
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)
Beispiel #18
0
def prof_init(version, status):
    synopsis = [ "/ascii <message>" ]
    description = "ASCIIfy a message."
    args = [
        [ "<message>", "The message to be ASCIIfied" ]
    ]
    examples = [
        "/ascii \"Hello there\""
    ]
    
    prof.register_command("/ascii", 1, 1, synopsis, description, args, examples, _cmd_ascii)
Beispiel #19
0
def prof_init(version, status, account_name, fulljid):
    synopsis = ["/imgur <file_path>", "/imgur screenshot"]
    description = "Upload an image or screenshot to imgur and send the link"
    args = [["<file_path>", "full path to image file"],
            ["screenshot", "upload a full screen capture"]]
    examples = ["/imgur ~/images/cats.jpg", "/imgur screenshot"]

    prof.register_command("/imgur", 1, 1, synopsis, description, args,
                          examples, _cmd_imgur)
    prof.completer_add("/imgur", ["screenshot"])
    prof.filepath_completer_add("/imgur")
Beispiel #20
0
def prof_init(version, status, account_name, fulljid):
    synopsis = ["/paste", "/paste newline on|off"]
    description = "Paste contents of clipboard."
    args = [[
        "newline on|off",
        "Send newline before multiline clipboard text, defaults to on"
    ]]
    examples = []
    prof.register_command("/paste", 0, 2, synopsis, description, args,
                          examples, _cmd_paste)
    prof.completer_add("/paste", ["newline"])
    prof.completer_add("/paste newline", ["on", "off"])
Beispiel #21
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [
        "/paste",
        "/paste newline on|off"
    ]
    description = "Paste contents of clipboard."
    args = [
        [ "newline on|off", "Send newline before multiline clipboard text, defaults to on" ]
    ]
    examples = []
    prof.register_command("/paste", 0, 2, synopsis, description, args, examples, _cmd_paste)
    prof.completer_add("/paste", [ "newline" ])
    prof.completer_add("/paste newline", [ "on", "off" ])
Beispiel #22
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [ 
        "/chatterbot",
        "/chatterbot enable|disable"
    ]
    description = "ChatterBot, running with no args will show the current chatterbot status"
    args = [
        [ "enable", "Enable chatterbot" ],
        [ "disable", "Disable chatterbot" ]
    ]
    examples = []

    prof.register_command("/chatterbot", 0, 1, synopsis, description, args, examples, _cmd_chatterbot)
    prof.completer_add("/chatterbot", [ "enable", "disable" ])
def prof_init(version, status):
        # prof.register_timed(_get_scores, 60) - for tweet feed
        prof.register_command("/twi-login", 0, 0,
            [ "twi-login" ],
            "Login to your twitter account",
            [],
            [],
            authorize_app_for_twitter)
        prof.register_command("/twi-pin", 1, 1,
            [ "/twi-pin <enter pin code generated from url>" ],
            "Enter your pin",
            [],
            [],
            _set_final_access_token)
        prof.register_command("/tweet", 1, 1,
            [ "/tweet \"<your tweet>\"" ],
            "Chirp what your thinking!",
            [],
            [],
            tweet)
        prof.register_command("/twi-help", 0, 0,
            [ "/twi-help" ],
            "List all commands for chirpy",
            [],
            [],
            help)
Beispiel #24
0
def prof_init(version, status, account_name, fulljid):
    synopsis = ["/system", "/system exec <comman>", "/system send <command>"]
    description = "Run a system command, calling with no arguments will open or focus the system window."
    args = [
        ["exec <command>", "Execute a command"],
        [
            "send <command>",
            "Send the result of the command to the current recipient or room"
        ]
    ]
    examples = ["/system exec ls -l", "/system send uname -a"]
    prof.register_command("/system", 0, 2, synopsis, description, args,
                          examples, _cmd_system)
    prof.completer_add("/system", ["exec", "send"])
Beispiel #25
0
def prof_init(version, status):
    synopsis = [ 
        "/browser",
        "/browser <url>"
    ]
    description = "View a URL in the systems default browser. If no argument is supplied, the last URL in the current chat or room will be used."
    args = [
        [ "<url>", "URL to open in the browser" ]
    ]
    examples = [
        "/browser http://www.profanity.im"
    ]

    prof.register_command("/browser", 0, 1, synopsis, description, args, examples, _cmd_browser)
Beispiel #26
0
def prof_init(version, status):
    synopsis = [ 
        "/say on|off",
        "/say test <message>"
    ]
    description = "Read all messages out loud"
    args = [
        [ "on|off",         "Enable/disable say" ],
        [ "test <message>", "Say message" ]
    ]
    examples = []

    prof.register_command("/say", 1, 2, synopsis, description, args, examples, _cmd_say)
    prof.register_ac("/say", [ "on", "off", "test" ])
Beispiel #27
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [
        "/copy",
        "/copy <message index>"
    ]
    description = "Copies message content to clipboard"
    args = [
        [ "<message index>", "Defines which message to copy (if not the latest)" ]
    ]
    examples = [
        "/copy",
        "/copy -1"
    ]
    prof.register_command("/copy", 0, 1, synopsis, description, args, examples, _cmd_copy)
    prof.cons_show("Command '/copy' registered successfully.")
Beispiel #28
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [ 
        "/browser",
        "/browser <url>"
    ]
    description = "View a URL in the systems default browser. If no argument is supplied, the last URL in the current chat or room will be used. " \
        "Tab autocompletion will go through all previous links in the current chat/room"
    args = [
        [ "<url>", "URL to open in the browser" ]
    ]
    examples = [
        "/browser http://www.profanity.im"
    ]

    prof.register_command("/browser", 0, 1, synopsis, description, args, examples, _cmd_browser)
Beispiel #29
0
def prof_init(version, status):

    synopsis = [
        "/omemo",
        "/omemo start|end [jid]"
    ]

    description = "Plugin to enable OMEMO encryption"
    args = [
        [ "start|end <jid>", "Start an OMEMO based conversation with <jid> window or current window." ]
    ]
    examples = []

    # ensure the plugin is not registered if python-omemo is not available
    prof.register_command("/omemo", 1, 2, synopsis, description, args, examples, _parse_args)
    prof.register_ac("/omemo", [ "start", "end"])
Beispiel #30
0
def prof_init(version, status):
    synopsis = [
        "/system",
        "/system <command>",
        "/system send <command>"
    ]
    description = "Run a system command, calling with no arguments will open or focus the system window."
    args = [
        [ "send <command>", "Send the result of the command to the current recipient or room" ],
        [ "<command>",      "The system command to run" ]
    ]
    examples = [
        "/system \"ls -l\"",
        "/system send \"uname -a\""
    ]
    prof.register_command("/system", 0, 2, synopsis, description, args, examples, _cmd_system)
    prof.register_ac("/system", [ "send" ])
Beispiel #31
0
def prof_init(version, status, account_name, fulljid):
    log.info('prof_init() called')
    synopsis = [
        '/omemo',
        '/omemo on|off',
        '/omemo start|end [jid]',
        '/omemo set'
        '/omemo status',
        '/omemo account',
        '/omemo fulljid',
        '/omemo fingerprints',
        '/omemo show_devices',
        '/omemo reset_devicelist'
    ]

    description = 'Plugin to enable OMEMO encryption'
    args = [
        ['on|off', 'Enable/Disable the Profanity OMEMO Plugin'],
        ['start|end <jid>', ('Start an OMEMO based conversation with <jid> '
                             'window or current window.')],
        ['set', 'Set Settings like Message Prefix'],
        ['status', 'Display the current Profanity OMEMO Plugin status.'],
        ['fingerprints <jid>', 'Display the known fingerprints for <jid>'],
        ['account', 'Show current account name'],
        ['reset_devicelist <jid>', 'Manually reset a contacts devicelist.'],
        ['fulljid', 'Show current <full-jid>']
    ]

    examples = []

    # ensure the plugin is not registered if python-omemo is not available
    prof.register_command('/omemo', 1, 3,
                          synopsis, description, args, examples, _parse_args)

    prof.completer_add('/omemo', ['on', 'off', 'status', 'start', 'end', 'set'
                                  'account', 'fulljid', 'show_devices',
                                  'reset_devicelist', 'fingerprints'])

    prof.completer_add('/omemo set', ['message_prefix'])

    # set user and init omemo only if account_name and fulljid provided
    if account_name is not None and fulljid is not None:
        ProfOmemoUser.set_user(account_name, fulljid)
        _init_omemo()
    else:
        log.warning('No User logged in on plugin.prof_init()')
def prof_init(version, status, account_name, fulljid):
    log.info('prof_init() called')
    synopsis = [
        '/omemo',
        '/omemo on|off',
        '/omemo start|end [jid]',
        '/omemo set'
        '/omemo status',
        '/omemo account',
        '/omemo fulljid',
        '/omemo fingerprints',
        '/omemo show_devices',
        '/omemo reset_devicelist'
    ]

    description = 'Plugin to enable OMEMO encryption'
    args = [
        ['on|off', 'Enable/Disable the Profanity OMEMO Plugin'],
        ['start|end <jid>', ('Start an OMEMO based conversation with <jid> '
                             'window or current window.')],
        ['set', 'Set Settings like Message Prefix'],
        ['status', 'Display the current Profanity OMEMO Plugin status.'],
        ['fingerprints <jid>', 'Display the known fingerprints for <jid>'],
        ['account', 'Show current account name'],
        ['reset_devicelist <jid>', 'Manually reset a contacts devicelist.'],
        ['fulljid', 'Show current <full-jid>']
    ]

    examples = []

    # ensure the plugin is not registered if python-omemo is not available
    prof.register_command('/omemo', 1, 3,
                          synopsis, description, args, examples, _parse_args)

    prof.completer_add('/omemo', ['on', 'off', 'status', 'start', 'end', 'set'
                                  'account', 'fulljid', 'show_devices',
                                  'reset_devicelist', 'fingerprints'])

    prof.completer_add('/omemo set', ['message_prefix'])

    # set user and init omemo only if account_name and fulljid provided
    if account_name is not None and fulljid is not None:
        ProfOmemoUser.set_user(account_name, fulljid)
        _init_omemo()
    else:
        log.warning('No User logged in on plugin.prof_init()')
Beispiel #33
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [
        "/system",
        "/system exec <comman>",
        "/system send <command>"
    ]
    description = "Run a system command, calling with no arguments will open or focus the system window."
    args = [
        [ "exec <command>", "Execute a command" ],
        [ "send <command>", "Send the result of the command to the current recipient or room" ]
    ]
    examples = [
        "/system exec ls -l",
        "/system send uname -a"
    ]
    prof.register_command("/system", 0, 2, synopsis, description, args, examples, _cmd_system)
    prof.completer_add("/system", [ "exec", "send" ])
Beispiel #34
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [
        "/say on|off|active", "/say args <args>", "/say clearargs",
        "/say test <message>"
    ]
    description = "Read messages out loud"
    args = [["on|off", "Enable/disable say for all windows"],
            ["active", "Enable say for active window only"],
            ["args <args>", "Arguments to pass to command"],
            ["clearargs", "Clear command arguments"],
            ["test <message>", "Say message"]]
    examples = []

    prof.register_command("/say", 0, 2, synopsis, description, args, examples,
                          _cmd_say)
    prof.completer_add("/say",
                       ["on", "off", "test", "active", "args", "clearargs"])
Beispiel #35
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):
    synopsis = [
        "/termuxnotify on|off|active", "/termuxnotify vibrate on|off",
        "/termuxnotify rooms on|off"
    ]
    description = "Read messages out loud"
    args = [["on|off", "Enable/disable termuxnotify for all windows"],
            ["active", "Enable termuxnotify for active window only"],
            ["vibrate <args>", "Turn vibrate on or off"],
            ["rooms <args>", "Turn notifications for rooms on or off"]]
    examples = []

    prof.register_command("/termuxnotify", 0, 2, synopsis, description, args,
                          examples, _cmd_say)
    prof.completer_add("/termuxnotify",
                       ["on", "off", "active", "vibrate", "rooms"])
    prof.completer_add("/termuxnotify vibrate", ["on", "off"])
    prof.completer_add("/termuxnotify rooms", ["on", "off"])
Beispiel #37
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [ 
        "/sounds",
        "/sounds on|off",
        "/sounds set chat <file>",
        "/sounds set room <file>",
        "/sounds set private <file>",
        "/sounds clear chat",
        "/sounds clear room",
        "/sounds clear private",
        "/sounds rooms add <roomjid>"
    ]
    description = "Play mp3 sounds on various Profanity events. Calling with no args shows current sound files."
    args = [
        [ "on|off", "Enable or disable playing sounds." ],
        [ "set chat <file>", "Path to mp3 file to play on chat messages." ],
        [ "set room <file>", "Path to mp3 file to play on room messages." ],
        [ "set private <file>", "Path to mp3 file to play on private room messages." ],
        [ "clear chat", "Remove the sound for chat messages." ],
        [ "clear room", "Remove the sound for room messages." ],
        [ "clear private", "Remove the sound for private messages." ],
        [ "rooms add <roomjid>", "Add the room to the list that will play the room sound."],
        [ "rooms remove <roomjid>", "Remove the room from the list that will play the room sound."],
        [ "rooms clear", "Clear the room list, all rooms will play sounds on new messages."]
    ]
    examples = [
        "/sounds set chat ~/sounds/woof.mp3",
        "/sounds set room ~/sounds/meow.mp3",
        "/sounds set private ~/sounds/shhh.mp3",
        "/sounds remove private",
        "/sounds rooms add [email protected]",
        "/sounds on"
    ]

    prof.register_command("/sounds", 0, 3, synopsis, description, args, examples, _cmd_sounds)

    prof.completer_add("/sounds", [ "set", "clear", "on", "off", "rooms" ])
    prof.completer_add("/sounds set", [ "chat", "room", "private" ])
    prof.completer_add("/sounds clear", [ "chat", "room", "private" ])
    prof.completer_add("/sounds rooms", [ "add", "remove", "clear" ])
    prof.filepath_completer_add("/sounds set chat")
    prof.filepath_completer_add("/sounds set room")
    prof.filepath_completer_add("/sounds set private")
Beispiel #38
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [ 
        "/say on|off|active",
        "/say args <args>",
        "/say clearargs",
        "/say test <message>"
    ]
    description = "Read messages out loud"
    args = [
        [ "on|off",         "Enable/disable say for all windows" ],
        [ "active",         "Enable say for active window only" ],
        [ "args <args>",    "Arguments to pass to command" ],
        [ "clearargs",      "Clear command arguments" ],
        [ "test <message>", "Say message" ]
    ]
    examples = []

    prof.register_command("/say", 0, 2, synopsis, description, args, examples, _cmd_say)
    prof.completer_add("/say", [ "on", "off", "test", "active", "args", "clearargs" ])
Beispiel #39
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [
        "/wikipedia search <text>", "/wikipedia summary <title>",
        "/wikipedia page <title>", "/wikipedia images <title>",
        "/wikipedia links <title>", "/wikipedia refs <title>",
        "/wikipedia open <url>"
    ]
    description = "Interact with wikipedia."
    args = [["search <text>", "Search for pages"],
            ["summary <title>", "Show summary for page"],
            ["page <title>", "Show the whole page"],
            ["images <title>", "Show images URLs for page"],
            ["links <title>", "Show links to other pages from page"],
            ["refs <title>", "Show external references for page"],
            ["open <url>", "Open the a URL in the browser"]]
    examples = ["/wikipedia search Iron Maiden"]

    prof.register_command("/wikipedia", 2, 2, synopsis, description, args,
                          examples, cmd_wp)

    prof.completer_add(
        "/wikipedia",
        ["search", "summary", "page", "images", "links", "refs", "open"])
def prof_init(version, status):
    synopsis = [
        "/shortcuts",
        "/shortcuts on|off",
        "/shortcuts set <name> <text>"
    ]
    description = "Manage shortcuts for emoticons or other stuff"
    args = [
        [ "on|off", "Enable/disable shortcuts" ],
        [ "set <name> <text>", "Save shortcut" ],
        [ "list", "List Shortcuts Dictionary"]
    ]
    examples = [
        "/shortcuts",
        "/shortcuts on",
        "/shortcuts set lol \"Laughing out loud\""
    ]

    prof.register_command("/shortcuts", 0, 3, synopsis, description, args, examples, _cmd_shortcuts)
    prof.register_ac("/shortcuts", [ "on", "off", "set" ])

    shortcut_keys = [":{}:".format(k) for k in SHORTCUTS_DICTIONARY.keys()]
    # prof.cons_show(", ".join(shortcut_keys))
    prof.register_ac(" ", shortcut_keys)
Beispiel #41
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)
Beispiel #42
0
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)
Beispiel #43
0
def prof_init(version, status):
    prof.register_command("/say", 0, 1, "/say message", "Say something.",
                          "Say something.", _cmd_say)
Beispiel #44
0
def prof_init(version, status):
    prof.register_command("/whoami", 0, 0, "/whoami", "Call shell whoami command.", "Call shell whoami command.", _cmd_whoami)
Beispiel #45
0
def prof_init(version, status):
    prof.register_command("/ascii", 1, 1, "/ascii", "ASCIIfy a message",
                          "ASCIIfy a message.", _cmd_ascii)
def prof_init(version, status):
    t = threading.Thread(target=_inc_counter)
    t.daemon = True
    t.start()
    prof.register_command("/count", 0, 0, "/count", "Threaded example", "Threaded example", _cmd_count)
Beispiel #47
0
def prof_init(version, status, account_name, fulljid):
    synopsis = [ 
        "/enc_py end <barejid>",
        "/enc_py chat_title set <barejid> <text>",
        "/enc_py chat_title unset <barejid>",
        "/enc_py chat_ch set in <barejid> <ch>",
        "/enc_py chat_ch reset in <barejid>",
        "/enc_py chat_ch set out <barejid> <ch>",
        "/enc_py chat_ch reset out <barejid>",
        "/enc_py chat_show <barejid> <message>",
        "/enc_py chat_show_themed <barejid> <message>",
        "/enc_py room_title set <roomjid> <text>",
        "/enc_py room_title unset <roomjid>"
        "/enc_py room_ch set <roomjid> <ch>",
        "/enc_py room_ch reset <roomjid>",
        "/enc_py room_show <roomjid> <message>",
        "/enc_py room_show_themed <roomjid> <message>"
        "/enc_py chat_msg none",
        "/enc_py chat_msg modify",
        "/enc_py chat_msg block",
        "/enc_py room_msg none",
        "/enc_py room_msg modify",
        "/enc_py room_msg block"
    ]
    description = "Various enc things"
    args = [
        [ "end <barejid>",                          "User to end the session with" ],
        [ "chat_title set <barejid> <text>",        "Set encryption text in titlebar for recipient" ],
        [ "chat_title reset <barejid>",             "Reset encryption text in titlebar for recipient" ],
        [ "chat_ch set in <barejid> <ch>",          "Set incoming char for recipient" ],
        [ "chat_ch reset in <barejid>",             "Reset incoming char for recipient" ],
        [ "chat_ch set out <barejid> <ch>",         "Set outgoing char for recipient" ],
        [ "chat_ch reset out <barejid>",            "Reset outgoing char for recipient" ],
        [ "chat_show <barejid> <message>",          "Show chat message" ],
        [ "chat_show_themed <barejid> <message>",   "Show themed chat message" ],
        [ "room_title set <roomjid> <text>",        "Set encryption text in titlebar for room" ],
        [ "room_title reset <roomjid>",             "Reset encryption text in titlebar for room" ],
        [ "room_ch set <roomjid> <ch>",             "Set char for room" ],
        [ "room_ch reset <roomjid>",                "Reset char for room" ],
        [ "room_show <roomjid> <message>",          "Show chat room message" ],
        [ "room_show_themed <roomjid> <message>",   "Show themed chat room message" ],
        [ "chat_msg none",                          "Preserve chat messages" ],
        [ "chat_msg modify",                        "Modify chat messages" ],
        [ "chat_msg block",                         "Block chat messages" ],
        [ "room_msg none",                          "Preserve chat room messages" ],
        [ "room_msg modify",                        "Modify chat room messages" ],
        [ "room_msg block",                         "Block chat room messages" ]
    ]
    examples = []

    prof.register_command("/enc_py", 2, 5, synopsis, description, args, examples, _cmd_enc)
    prof.completer_add("/enc_py", [
        "end",
        "chat_title",
        "chat_ch",
        "chat_show",
        "chat_show_themed",
        "room_title",
        "room_ch",
        "room_show",
        "room_show_themed",
        "chat_msg",
        "room_msg"
    ])
    prof.completer_add("/enc_py chat_title", [ "set", "reset" ])
    prof.completer_add("/enc_py chat_ch", [ "set", "reset" ])
    prof.completer_add("/enc_py chat_ch set", [ "in", "out" ])
    prof.completer_add("/enc_py chat_ch reset", [ "in", "out" ])
    prof.completer_add("/enc_py room_title", [ "set", "reset" ])
    prof.completer_add("/enc_py room_ch", [ "set", "reset" ])
    prof.completer_add("/enc_py chat_msg", [ "none", "modify", "block" ])
    prof.completer_add("/enc_py room_msg", [ "none", "modify", "block" ])
Beispiel #48
0
def prof_init(version, status):
    prof.register_command("/ascii", 1, 1, "/ascii", "ASCIIfy a message", "ASCIIfy a message.", _cmd_ascii)
def prof_init(version, status):
    prof.register_command("/platform", 0, 0, "/platform", "Output system information.", "Output system information", _cmd_platform)
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)
Beispiel #51
0
def prof_init(version, status):
    prof.register_command("/platform", 0, 0, "/platform",
                          "Output system information.",
                          "Output system information", _cmd_platform)
def prof_init(version, status):
    t = threading.Thread(target=_inc_counter)
    t.daemon = True
    t.start()
    prof.register_command("/count", 0, 0, "/count", "Threaded example",
                          "Threaded example", _cmd_count)
Beispiel #53
0
def prof_init(version, status):
    prof.register_command("/say", 0, 1, "/say message", "Say something.", "Say something.",
        _cmd_say)
Beispiel #54
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)
Beispiel #55
0
def prof_init(version, status):
    prof.register_command("/whoami", 0, 0, "/whoami",
                          "Call shell whoami command.",
                          "Call shell whoami command.", _cmd_whoami)
Beispiel #56
0
def prof_init(version, status, account_name, fulljid):
    synopsis = ["/paste"]
    description = "Paste contents of clipboard."
    args = []
    examples = []
    prof.register_command("/paste", 0, 0, synopsis, description, args, examples, _cmd_paste)