Esempio n. 1
0
def adjust_options(options, args):
    # --- CUT here ---
    """
    Display MENU_TXT
    """
    sys.stderr.write(
        c.colorize("PyLucid virtual environment bootstrap\n\n",
                   opts=("bold", "underscore")))

    try:
        home_dir = args[0]
    except IndexError:
        return  # caller will raise error

    sys.stdout.write("Create PyLucid environment in: %s" %
                     c.colorize(home_dir, foreground="blue", opts=("bold", )))
    sys.stdout.write("\n\n")

    p = SysPath()

    git_path = p.find("git")
    if git_path:
        sys.stderr.write("git found in: %s\n" %
                         c.colorize(git_path, opts=("bold", )))
    else:
        sys.stderr.write(
            c.colorize("ERROR:", foreground="red", opts=("underscore", )))
        sys.stderr.write("git not found in path!\n")

    if options.install_type == None:
        options.install_type = get_requirement_choice()
    elif options.install_type not in CHOICES.values():
        sys.stderr.write("install type wrong!")
        sys.exit(-1)
Esempio n. 2
0
def adjust_options(options, args):
    # --- CUT here ---
    """
    Display MENU_TXT
    """
    sys.stderr.write(c.colorize("PyLucid virtual environment bootstrap\n\n", opts=("bold", "underscore")))

    try:
        home_dir = args[0]
    except IndexError:
        return  # caller will raise error

    sys.stdout.write("Create PyLucid environment in: %s" % c.colorize(home_dir, foreground="blue", opts=("bold",)))
    sys.stdout.write("\n\n")

    p = SysPath()

    git_path = p.find("git")
    if git_path:
        sys.stderr.write("git found in: %s\n" % c.colorize(git_path, opts=("bold",)))
    else:
        sys.stderr.write(c.colorize("ERROR:", foreground="red", opts=("underscore",)))
        sys.stderr.write("git not found in path!\n")

    if options.install_type == None:
        options.install_type = get_requirement_choice()
    elif options.install_type not in CHOICES.values():
        sys.stderr.write("install type wrong!")
        sys.exit(-1)
Esempio n. 3
0
def extend_parser(parser):
    # --- CUT here ---
    parser.add_option("-t", "--type", type="string",
        dest="install_type", default=None,
        help="PyLucid install type: %s (Choose via menu!)" % ", ".join(list(CHOICES.values()))
    )