Example #1
0
def main():
    if len(sys.argv) != 2:
        print("syntax:", sys.argv[0], "<cig_code>")
        exit(-1)

    cig_code = sys.argv[1]

    all_cig_codes = cig_codes.list_cig_codes()
    if cig_code not in all_cig_codes and cig_code != "all":
        print("Unknown code:", cig_code)
        exit(-1)

    if cig_code == "all": code_list = all_cig_codes
    else: code_list = [cig_code]

    for code in code_list:
        code_details = cig_codes.query_cig_code(code)
        if code_details["repo_type"] is "git":
            revs = get_recent_git_revisions(code_details)
        else:
            print("unsupported repo type")
            revs = []

        #print(code, revs)
        process_code_revisions(code, revs)
Example #2
0
def main():
    if len(sys.argv) != 2:
        print("syntax:", sys.argv[0], "<cig_code>")
        exit(-1)

    cig_code = sys.argv[1]

    all_cig_codes = cig_codes.list_cig_codes()
    if cig_code not in all_cig_codes and cig_code != "all":
        print("Unknown code:", cig_code)
        exit(-1)

    if cig_code == "all": code_list = all_cig_codes
    else: code_list = [cig_code]

    for code in code_list:
        code_details = cig_codes.query_cig_code(code)
        if code_details["repo_type"] is "git":
            revs = get_recent_git_revisions(code_details)
        else:
            print("unsupported repo type")
            revs = []

        #print(code, revs)
        process_code_revisions(code, revs)
def main():
    if len(sys.argv) != 3:
        print(sys.argv[0], "<oauth token> <cmd>")
        print("<cmd> may be check, install or trigger")
        exit(1)

    # Get the GitHub OAuth token to allow these operations
    github_oauth_token = sys.argv[1]
    cmd = sys.argv[2]

    # Get the list of CIG git codes
    code_list = [
        code for code in cig_codes.list_cig_codes()
        if cig_codes.query_cig_code(code)["repo_type"] == "git"
    ]
    if cmd == "check":
        for code in code_list:
            check_install_hooks(code, github_oauth_token, False)
    elif cmd == "install":
        for code in code_list:
            check_install_hooks(code, github_oauth_token, True)
    elif cmd == "trigger":
        for code in code_list:
            trigger_hook(code, github_oauth_token)
            time.sleep(10)
    else:
        print("Unknown command:", cmd)
        exit(1)
Example #4
0
def main():
    if len(sys.argv) != 3:
        print(sys.argv[0], "<oauth token> <cmd>")
        print("<cmd> may be check, install or trigger")
        exit(1)

    # Get the GitHub OAuth token to allow these operations
    github_oauth_token = sys.argv[1]
    cmd = sys.argv[2]

    # Get the list of CIG git codes
    code_list = [code for code in cig_codes.list_cig_codes() if cig_codes.query_cig_code(code)["repo_type"] == "git"]
    if cmd == "check":
        for code in code_list:
            check_install_hooks(code, github_oauth_token, False)
    elif cmd == "install":
        for code in code_list:
            check_install_hooks(code, github_oauth_token, True)
    elif cmd == "trigger":
        for code in code_list:
            trigger_hook(code, github_oauth_token)
            time.sleep(10)
    else:
        print("Unknown command:", cmd)
        exit(1)
Example #5
0
def main():
    arg_error = False
    revision = None
    dry_run = False
    use_repo = False

    if len(sys.argv) < 2: arg_error = True
    else: cig_code = sys.argv[1]

    for arg_num in range(2, len(sys.argv)):
        if sys.argv[arg_num] == "--revision":
            revision = sys.argv[arg_num+1]
            use_repo = True
        elif sys.argv[arg_num] == "--dry_run":
            dry_run = True

    if arg_error:
        print("syntax:", sys.argv[0], "<code_name> [--revision rev_num] [--dry_run]")
        exit(1)

    all_cig_codes = cig_codes.list_cig_codes()
    if cig_code == "all": code_list = all_cig_codes
    else: code_list = [cig_code]

    for check_code in code_list:
        if check_code not in all_cig_codes
            print("unknown code:", check_code)
            exit(1)

        test_code(check_code, revision, dry_run, use_repo)
def main():
    if len(sys.argv) != 3:
        print("syntax:", sys.argv[0], "[code_name|all] [release|dev]")
        exit(1)

    # Parse input arguments
    req_name = sys.argv[1]
    code_type = sys.argv[2]
    if code_type != "release" and code_type != "dev":
        print("Unknown type (must be release or dev)")
        exit(1)

    # Go through all the recorded CIG codes
    for code_name in cig_codes.list_cig_codes():
        if req_name != "all" and req_name != code_name: continue
        cmd_dict = {}
        code_details = cig_codes.query_cig_code(code_name)
        cmd_dict["queue_cmd"] = "../queue/queue_daemon.sh backend_queue"
        cmd_dict["code_name"] = code_name
        cmd_dict["full_name"] = code_details["package_title"]
        if code_type == "release" and code_details["release_doxygen"] == "y":
            cmd_dict["code_url"] = code_details["release_src_url"]
            cmd_dict["code_version"] = code_details["release_src_version"]
            sys_cmd = "{queue_cmd} \"cd `pwd` ; ./generate_doxygen.sh url {code_url} {code_version} \\\"{full_name}\\\" {code_name}\" &".format(
                **cmd_dict)
            os.system(sys_cmd)
        elif code_type == "dev" and code_details["dev_doxygen"] == "y":
            cmd_dict["repo_url"] = code_details["repo_url"]
            cmd_dict["repo_type"] = code_details["repo_type"]
            # Determine the latest revision number of the repository
            if code_details["repo_type"] == "git":
                cmd_dict["repo_version"] = subprocess.check_output(
                    "git ls-remote {repo_url}".format(
                        **cmd_dict).split()).split()[0]
            else:
                print("Unknown repository type for", code_name,
                      "(must be git)")
                exit(1)
            sys_cmd = "{queue_cmd} \"cd `pwd` ; ./generate_doxygen.sh {repo_type} {repo_url} {repo_version} \\\"{full_name}\\\" {code_name}\" &".format(
                **cmd_dict)
            os.system(sys_cmd)
Example #7
0
def main():
    if len(sys.argv) < 5 or len(sys.argv) > 7:
        print("syntax:", sys.argv[0], "HIT_DB_NAME LOCATION_DB_NAME OUTPUT_DIR PACKAGE_NAME <START_TIME> <END_TIME>")
        print("START_TIME and END_TIME must be in UNIX epoch format (seconds since Jan 1 1970)")
        exit(1)

    HIT_DB_NAME = sys.argv[1]
    LOCATION_DB_NAME = sys.argv[2]
    OUTPUT_DIR = sys.argv[3]
    PACKAGE_NAME = sys.argv[4]
    if len(sys.argv) > 5: START_TIME = datetime.datetime.fromtimestamp(int(sys.argv[5]))
    else: START_TIME = datetime.datetime.fromtimestamp(0)
    if len(sys.argv) > 6: END_TIME = datetime.datetime.fromtimestamp(int(sys.argv[6]))
    else: END_TIME = datetime.datetime.now()
    print(START_TIME, END_TIME)

    # For the command "all" generate maps for all codes listed in the code_db
    if PACKAGE_NAME == "all":
        for code_name in cig_codes.list_cig_codes():
            generate_plot(HIT_DB_NAME, LOCATION_DB_NAME, OUTPUT_DIR, code_name, START_TIME, END_TIME)
    else:
        generate_plot(HIT_DB_NAME, LOCATION_DB_NAME, OUTPUT_DIR, PACKAGE_NAME, START_TIME, END_TIME)
Example #8
0
def main():
    if len(sys.argv) != 3:
        print("syntax:", sys.argv[0], "[code_name|all] [release|dev]")
        exit(1)

    # Parse input arguments
    req_name = sys.argv[1]
    code_type = sys.argv[2]
    if code_type != "release" and code_type != "dev":
        print("Unknown type (must be release or dev)")
        exit(1)

    # Go through all the recorded CIG codes
    for code_name in cig_codes.list_cig_codes():
        if req_name != "all" and req_name != code_name: continue
        cmd_dict = {}
        code_details = cig_codes.query_cig_code(code_name)
        cmd_dict["queue_cmd"] = "../queue/queue_daemon.sh backend_queue"
        cmd_dict["code_name"] = code_name
        cmd_dict["full_name"] = code_details["package_title"]
        if code_type == "release" and code_details["release_doxygen"] == "y":
            cmd_dict["code_url"] = code_details["release_src_url"]
            cmd_dict["code_version"] = code_details["release_src_version"]
            sys_cmd = "{queue_cmd} \"cd `pwd` ; ./generate_doxygen.sh url {code_url} {code_version} \\\"{full_name}\\\" {code_name}\" &".format(**cmd_dict)
            os.system(sys_cmd)
        elif code_type == "dev" and code_details["dev_doxygen"] == "y":
            cmd_dict["repo_url"] = code_details["repo_url"]
            cmd_dict["repo_type"] = code_details["repo_type"]
            # Determine the latest revision number of the repository
            if code_details["repo_type"] == "git":
                cmd_dict["repo_version"] = subprocess.check_output("git ls-remote {repo_url}".format(**cmd_dict).split()).split()[0]
            else:
                print("Unknown repository type for", code_name, "(must be git)")
                exit(1)
            sys_cmd = "{queue_cmd} \"cd `pwd` ; ./generate_doxygen.sh {repo_type} {repo_url} {repo_version} \\\"{full_name}\\\" {code_name}\" &".format(**cmd_dict)
            os.system(sys_cmd)
Example #9
0
from __future__ import print_function

import cig_codes
import urllib
import sys

if len(sys.argv) != 3:
    print(sys.argv[0], "<cig code|all>", "<location to store manuals>")
    exit(1)

# Read the command line arguments
code_name = sys.argv[1]
location = sys.argv[2]

if code_name == "all":
    code_list = cig_codes.list_cig_codes()
else:
    code_list = [code_name]

# Download the manual for each code with one
for code in code_list:
    code_data = cig_codes.query_cig_code(code)
    if code_data['has_manual'] == 'y':
        manual_file = location+"/"+code+"-manual.pdf"
        manual_url = code_data['manual_url']
        print("Downloading manual for", code, "from", manual_url)
        urllib.urlretrieve(manual_url, manual_file)


Example #10
0
#!/usr/bin/env python

from __future__ import print_function

import cig_codes
import urllib
import sys

if len(sys.argv) != 3:
    print(sys.argv[0], "<cig code|all>", "<location to store manuals>")
    exit(1)

# Read the command line arguments
code_name = sys.argv[1]
location = sys.argv[2]

if code_name == "all":
    code_list = cig_codes.list_cig_codes()
else:
    code_list = [code_name]

# Download the manual for each code with one
for code in code_list:
    code_data = cig_codes.query_cig_code(code)
    if code_data['has_manual'] == 'y':
        manual_file = location + "/" + code + "-manual.pdf"
        manual_url = code_data['manual_url']
        print("Downloading manual for", code, "from", manual_url)
        urllib.urlretrieve(manual_url, manual_file)