Exemplo n.º 1
0
def _ask_base_system(_probe, _b_prober, _pseed_):
    """Upon failed auto-os-probe, manually list available seeds
    """
    stage = 'ask-base-system'
    pycone._print_log('##', stage, '##')##

    sys_q_list = pycone._system_list()
    # return a list of choices from available system seeds

    list_w_other = sys_q_list + ['Other']
    # remember quit & help are added later, therefore are not part of len

    choice = pycone._choose_from(list_w_other, pyconeQ.user_source_system + pyconeQ.base_sys_msg)
    # this is the users choice, 'other' == (len(list) - 2)
    pycone._print_log(list_w_other, choice, stage)##

    base_system = str.lower(list_w_other[choice])
    # make the choice to lower letter for manipulation
    pycone._print_log((len(list_w_other)), base_system, stage)##

    # if choice is other, source system is unsupported and cannot have 'Backup'
    if choice == (len(list_w_other)-1):
        _dist_seed_ = 'other'
        _b_prober = False
    else:
        _dist_seed_ = base_system
        # get the seed's complete name
        _b_prober = True

    pycone._print_log(_dist_seed_, _b_prober, stage)##
    _ask_for_source_of_new_iso(_dist_seed_, _b_prober, _pseed_)
Exemplo n.º 2
0
def _get_base_system(source):
    stage = 'get base system'
    pycone._print_log('', stage)

    sys_q_list = pycone._system_list()
    # return a list of choices from available system seeds and quit/help
    pycone._print_log(sys_q_list, stage)

    choice_list = pycone._choice_list(sys_q_list)
    # return a numerated list of choices for user
    pycone._print_log(choice_list, stage)

    choice = pycone._choose_from(sys_q_list, pyconeQ.base_sys)
    # return the users choice
    pycone._print_log(choice + 1, stage)

    pycone._do_help_quit(choice, sys_q_list + pyconeQ.quit_help_list)## this seems incorrect
    # allows 'help' and 'quit' choices to work

    base_system = str.lower(sys_q_list[choice])
    # make the choice to lower letter for easier manipulation
    pycone._print_log(base_system, stage)

    base_sys = pycone._base(base_system)
    # get the full seed name
    pycone._print_log(base_sys, stage)

    # master_seed =
    # creates a master seed from base + user + main seeds

    base_sys_seed = pycone.pyne_dir(base_sys)
    # get the full seed path and name
    pycone._print_log(base_sys_seed, stage)

    return base_sys