Esempio n. 1
0
def _cmd_upper(line):
    global _win_tag;
    if prof.win_exists(_win_tag) == False:
        prof.win_create(_win_tag, _handle_upper)

    prof.win_focus(_win_tag)

    if line:
        _handle_upper(_win_tag, line)
Esempio n. 2
0
def _prof_callback():
    global changes_list
    if poll_fail:
        if not prof.win_exists(win_tag):
            prof.win_create(win_tag, _handle_input)
        prof.win_show(win_tag, "Could not connect to jenkins, see the logs.")
        if poll_fail_message:
            prof.log_warning("Jenkins poll failed: " + str(poll_fail_message))
        else:
            prof.log_warning("Jenkins poll failed")
    elif changes_list:
        for name in changes_list.get_in_state(STATE_QUEUED):
            if not prof.win_exists(win_tag):
                prof.win_create(win_tag, _handle_input)
            prof.win_show_themed(win_tag, None, None, "cyan",
                                 name + " " + STATE_QUEUED)
        for name in changes_list.get_in_state(STATE_RUNNING):
            if not prof.win_exists(win_tag):
                prof.win_create(win_tag, _handle_input)
            prof.win_show_themed(win_tag, None, None, "cyan",
                                 name + " " + STATE_RUNNING)
        for name, build_number in changes_list.get_in_state(STATE_SUCCESS):
            if not prof.win_exists(win_tag):
                prof.win_create(win_tag, _handle_input)
            prof.win_show_themed(
                win_tag, None, None, "green",
                name + " #" + str(build_number) + " " + STATE_SUCCESS)
            if enable_notify:
                prof.notify(name + " " + STATE_SUCCESS, 5000, "Jenkins")
        for name, build_number in changes_list.get_in_state(STATE_UNSTABLE):
            if not prof.win_exists(win_tag):
                prof.win_create(win_tag, _handle_input)
            prof.win_show_themed(
                win_tag, None, None, "yellow",
                name + " #" + str(build_number) + " " + STATE_UNSTABLE)
            if enable_notify:
                prof.notify(name + " " + STATE_UNSTABLE, 5000, "Jenkins")
        for name, build_number in changes_list.get_in_state(STATE_FAILURE):
            if not prof.win_exists(win_tag):
                prof.win_create(win_tag, _handle_input)
            prof.win_show_themed(
                win_tag, None, None, "red",
                name + " #" + str(build_number) + " " + STATE_FAILURE)
            if enable_notify:
                prof.notify(name + " " + STATE_FAILURE, 5000, "Jenkins")

        changes_list = None
Esempio n. 3
0
def _prof_callback():
    global changes_list
    if poll_fail:
        if not prof.win_exists(win_tag):
            prof.win_create(win_tag, _handle_input)
        prof.win_show(win_tag, "Could not connect to jenkins, see the logs.")
        if poll_fail_message:
            prof.log_warning("Jenkins poll failed: " + str(poll_fail_message))
        else:
            prof.log_warning("Jenkins poll failed")
    elif changes_list:
        for name in changes_list.get_in_state(STATE_QUEUED):
            if not prof.win_exists(win_tag):
                prof.win_create(win_tag, _handle_input)
            prof.win_show_themed(win_tag, None, None, "cyan", name + " " + STATE_QUEUED)
        for name in changes_list.get_in_state(STATE_RUNNING):
            if not prof.win_exists(win_tag):
                prof.win_create(win_tag, _handle_input)
            prof.win_show_themed(win_tag, None, None, "cyan", name + " " + STATE_RUNNING)
        for name, build_number in changes_list.get_in_state(STATE_SUCCESS):
            if not prof.win_exists(win_tag):
                prof.win_create(win_tag, _handle_input)
            prof.win_show_themed(win_tag, None, None, "green", name + " #" + str(build_number) + " " + STATE_SUCCESS)
            if enable_notify:
                prof.notify(name + " " + STATE_SUCCESS, 5000, "Jenkins")
        for name, build_number in changes_list.get_in_state(STATE_UNSTABLE):
            if not prof.win_exists(win_tag):
                prof.win_create(win_tag, _handle_input)
            prof.win_show_themed(win_tag, None, None, "yellow", name + " #" + str(build_number) + " " + STATE_UNSTABLE)
            if enable_notify:
                prof.notify(name + " " + STATE_UNSTABLE, 5000, "Jenkins")
        for name, build_number in changes_list.get_in_state(STATE_FAILURE):
            if not prof.win_exists(win_tag):
                prof.win_create(win_tag, _handle_input)
            prof.win_show_themed(win_tag, None, None, "red", name + " #" + str(build_number) + " " + STATE_FAILURE)
            if enable_notify:
                prof.notify(name + " " + STATE_FAILURE, 5000, "Jenkins")

        changes_list = None
Esempio n. 4
0
def create_win():
    if prof.win_exists(system_win) == False:
        prof.win_create(system_win, _handle_win_input)
Esempio n. 5
0
def _cmd_jenkins(cmd=None, arg=None):
    global enable_remind
    global enable_notify

    if not prof.win_exists(win_tag):
        prof.win_create(win_tag, _handle_input)

    prof.win_focus(win_tag)

    if cmd == "jobs":
        if job_list and job_list.get_jobs():
            prof.win_show(win_tag, "Jobs:")
            _list_jobs(job_list.get_jobs())
        else:
            prof.win_show(win_tag, "No job data yet.")
    elif cmd == "failing":
        if job_list:
            jobs_in_state = job_list.get_jobs(STATE_FAILURE)
            if jobs_in_state:
                prof.win_show(win_tag, "Failing jobs:")
                _list_jobs(jobs_in_state)
            else:
                prof.win_show(win_tag, "No failing jobs.")
        else:
            prof.win_show(win_tag, "No job data yet.")
    elif cmd == "passing":
        if job_list:
            jobs_in_state = job_list.get_jobs(STATE_SUCCESS)
            if jobs_in_state:
                prof.win_show(win_tag, "Passing jobs:")
                _list_jobs(jobs_in_state)
            else:
                prof.win_show(win_tag, "No passing jobs.")
        else:
            prof.win_show(win_tag, "No job data yet.")
    elif cmd == "unstable":
        if job_list:
            jobs_in_state = job_list.get_jobs(STATE_UNSTABLE)
            if jobs_in_state:
                prof.win_show(win_tag, "Unstable jobs:")
                _list_jobs(jobs_in_state)
            else:
                prof.win_show(win_tag, "No unstable jobs.")
        else:
            prof.win_show(win_tag, "No job data yet.")
    elif cmd == "build":
        if not arg:
            prof.win_show(win_tag, "You must supply a job argument.")
        elif job_list and job_list.contains_job(arg):
            _build_job(arg)
        else:
            prof.win_show(win_tag, "No such job: " + arg)
    elif cmd == "open":
        if not arg:
            prof.win_show(win_tag, "You must supply a job argument.")
        elif job_list and job_list.contains_job(arg):
            _open_job_url(jenkins_url + "/job/" + arg)
        else:
            prof.win_show(win_tag, "No such job: " + arg)
    elif cmd == "remind":
        if not arg:
            prof.win_show(win_tag, "You must specify either 'on' or 'off'.")
        elif arg == "on":
            enable_remind = True
            prof.win_show(win_tag, "Reminder notifications enabled.")
        elif arg == "off":
            enable_remind = False
            prof.win_show(win_tag, "Reminder notifications disabled.")
        else:
            prof.win_show(win_tag, "You must specify either 'on' or 'off'.")
    elif cmd == "notify":
        if not arg:
            prof.win_show(win_tag, "You must specify either 'on' or 'off'.")
        elif arg == "on":
            enable_notify = True
            prof.win_show(win_tag, "Build notifications enabled.")
        elif arg == "off":
            enable_notify = False
            prof.win_show(win_tag, "Build notifications disabled.")
        else:
            prof.win_show(win_tag, "You must specify either 'on' or 'off'.")
    elif cmd == "settings":
        _settings()
    elif cmd == "help":
        _help()
    elif cmd == "log":
        if not arg:
            prof.win_show(win_tag, "You must specify a job.")
        else:
            job = job_list.get_job(arg)
            if job:
                _job_log(job)
            else:
                prof.win_show(win_tag, "No job found: " + arg)
    else:
        prof.win_show(win_tag, "Unknown command.")
Esempio n. 6
0
def _create_win():
    if prof.win_exists(clients_win) == False:
        prof.win_create(clients_win, _handle_win_input)
def create_win():
    if prof.win_exists(plugin_win) == False:
        prof.win_create(plugin_win, _handle_win_input)
Esempio n. 8
0
def _cmd_jenkins(cmd=None, arg=None):
    global enable_remind
    global enable_notify

    if not prof.win_exists(win_tag):
        prof.win_create(win_tag, _handle_input)

    prof.win_focus(win_tag)

    if cmd == "jobs":
        if job_list and job_list.get_jobs():
            prof.win_show(win_tag, "Jobs:")
            _list_jobs(job_list.get_jobs())
        else:
            prof.win_show(win_tag, "No job data yet.")
    elif cmd == "failing":
        if job_list:
            jobs_in_state = job_list.get_jobs(STATE_FAILURE)
            if jobs_in_state:
                prof.win_show(win_tag, "Failing jobs:")
                _list_jobs(jobs_in_state)
            else:
                prof.win_show(win_tag, "No failing jobs.")
        else:
            prof.win_show(win_tag, "No job data yet.")
    elif cmd == "passing":
        if job_list:
            jobs_in_state = job_list.get_jobs(STATE_SUCCESS)
            if jobs_in_state:
                prof.win_show(win_tag, "Passing jobs:")
                _list_jobs(jobs_in_state)
            else:
                prof.win_show(win_tag, "No passing jobs.")
        else:
            prof.win_show(win_tag, "No job data yet.")
    elif cmd == "unstable":
        if job_list:
            jobs_in_state = job_list.get_jobs(STATE_UNSTABLE)
            if jobs_in_state:
                prof.win_show(win_tag, "Unstable jobs:")
                _list_jobs(jobs_in_state)
            else:
                prof.win_show(win_tag, "No unstable jobs.")
        else:
            prof.win_show(win_tag, "No job data yet.")
    elif cmd == "build":
        if not arg:
            prof.win_show(win_tag, "You must supply a job argument.")
        elif job_list and job_list.contains_job(arg):
            _build_job(arg)
        else:
            prof.win_show(win_tag, "No such job: " + arg)
    elif cmd == "open":
        if not arg:
            prof.win_show(win_tag, "You must supply a job argument.")
        elif job_list and job_list.contains_job(arg):
            _open_job_url(jenkins_url + "/job/" + arg)
        else:
            prof.win_show(win_tag, "No such job: " + arg)
    elif cmd == "remind":
        if not arg:
            prof.win_show(win_tag, "You must specify either 'on' or 'off'.")
        elif arg == "on":
            enable_remind = True
            prof.win_show(win_tag, "Reminder notifications enabled.")
        elif arg == "off":
            enable_remind = False
            prof.win_show(win_tag, "Reminder notifications disabled.")
        else:
            prof.win_show(win_tag, "You must specify either 'on' or 'off'.")
    elif cmd == "notify":
        if not arg:
            prof.win_show(win_tag, "You must specify either 'on' or 'off'.")
        elif arg == "on":
            enable_notify = True
            prof.win_show(win_tag, "Build notifications enabled.")
        elif arg == "off":
            enable_notify = False
            prof.win_show(win_tag, "Build notifications disabled.")
        else:
            prof.win_show(win_tag, "You must specify either 'on' or 'off'.")
    elif cmd == "settings":
        _settings()
    elif cmd == "help":
        _help()
    elif cmd == "log":
        if not arg:
            prof.win_show(win_tag, "You must specify a job.")
        else:
            job = job_list.get_job(arg)
            if job:
                _job_log(job)
            else:
                prof.win_show(win_tag, "No job found: " + arg)
    else:
        prof.win_show(win_tag, "Unknown command.")
Esempio n. 9
0
def create_win():
    if prof.win_exists(system_win) == False:
        prof.win_create(system_win, _handle_win_input)
Esempio n. 10
0
def _create_win():
    if prof.win_exists(clients_win) == False:
        prof.win_create(clients_win, _handle_win_input)