def _confirm_os_probe(_pseed_): """Probes the system, returns the result and asks user to confirm. Works with system backup, not needed for iso or bootstrap. """ stage = 'confirm-os-probe' _pseed_ = pycone._master_seed(None) # create a pre-master-seed; no <distro>-seed pycone._print_log('### pseed ###', _pseed_, 'test')## _probed_name = pycone._os_prober(_pseed_) # get the system through prober _probed_sys = pycone._base(_probed_name) # return the full distro-seed name, if exists c_pseed = str.capitalize(str(_probed_name)) # capitalized string just for use in query pycone._print_log(_probed_name, _probed_sys, stage)## if (_probed_sys != False): # be sure base did not return false(ie distro seed does not exist) choice = pycone._choose_from(pyconeQ.yes_no_list, pyconeQ.which_system % c_pseed + '\n' + stage) # probe current system, then user confirm choice_list = [_ask_for_source_of_new_iso, _ask_base_system] # on yes, go create master seed, then continue to question for Backup, etc # on no, continue to manual list of options, check with seedlist, then on to Backup (just a detour)if seedlist != False _b_prober = True # states os_prober returned a name, correct or not pycone._print_log(pyconeQ.yes_no_list, choice + 1, stage)## pycone._print_log(c_pseed, None, stage)## choice_list[choice](_probed_name, _b_prober, _pseed_) else: _b_prober = False _ask_base_system(None, _b_prober, _pseed_)
def _ask_existing_new_build(): """begin with choice of an existing build file or creation of a new build file """ stage = 'begin' pycone._print_log('', stage)## choice = pycone._choose_from(pyconeQ.level_list, pyconeQ.welcome_msg) # create a list of choices return the users choice pycone._print_log(pyconeQ.level_list, stage)## pycone._print_log(choice + 1, stage)## if choice == 0: #choose to use existing builder config pycone._print_log('use auto conf', stage)## print('not yet functional') pycone._exit() # no need to write to autoseed, read from it elif choice == 1: # choose to create a new builder config #_write_to_auto_seed('[autoseed]','', 'new') pycone._print_log('create a new conf', stage)## _pseed_ = pycone._os_prober(pycone._master_seed('')) _ask_source_system(_pseed_) else: pycone._do_help_quit(choice, pyconeQ.level_list)
def _confirm_base_system(empty): """Probes the system, returns the result and asks user to confirm. Works with system backup, not needed for iso or bootstrap. """ stage = 'confirm-base-system' _pseed_ = pycone._master_seed('') pycone._print_log('pseed ####', _pseed_, 'test')## _probe = pycone._os_prober(_pseed_) # get the system through prober _probed_sys = pycone._base(_probe) # return the full distro-seed name, if exists c_pseed = str.capitalize(str(_probe)) # capitalized string just for use in query pycone._print_log(_probe, _probed_sys, stage)## if (_probed_sys != False): # be sure base did not return false(ie distro seed does not exist) choice = pycone._choose_from(pyconeQ.yes_no_list, pyconeQ.which_system % c_pseed) # probe current system, then user confirm choice_list = [_seed_probe_match, _get_base_system] # on yes, go create master seed, then continue to question for Backup, etc # on no, continue to manual list of options, check with seedlist, then on to Backup (just a detour)if seedlist != False ## create the create-master-seed def pycone._print_log(pyconeQ.yes_no_list, choice + 1, stage)## pycone._print_log(c_system, '', stage)## choice_list[choice](_probe) else: pass
def _confirm_base_system(empty):#### new version being worked on """Probes the system, returns the result and asks user to confirm. Works with system backup, not needed for iso or bootstrap. """ stage = 'confirm-base-system' _probe = pycone._os_prober(_pseed_) c_pseed = str.capitalize(_probe) #base = pycone._base(_pseed_) #_mseed_ = pycone._master_seed(str.lower(base)) choice = pycone._choose_from(pyconeQ.yes_no_list, pyconeQ.which_system % c_pseed + '\n' + stage) # probe current system, then user confirm choice_list = [_create_master_seed, _get_base_system] ## create the create-master-seed def ## use pycone._seedlist() and _os_prober() to compare and ## confirm a seed file exists for current system pycone._print_log(pyconeQ.yes_no_list, choice + 1, stage)## pycone._print_log(c_system, '', stage)## choice_list[choice](_probe)
def _q_base_system(): system = pycone._os_prober(pycone._master_seed('')) stage = 'rsync' pycone._print_log('', stage)## c_system = str.capitalize(system) choice = pycone._choose_from(pyconeQ.yes_no_list, pyconeQ.which_system % c_system) # return the users choice pycone._print_log(pyconeQ.yes_no_list, stage) pycone._print_log(choice + 1, stage) if choice == 0: # choose a backup of current system pycone._print_log(choice + 1, stage) #pycone._rsync_live(seed) print('use %s system' % c_system) elif choice == 1: # choose to use an existing iso file #_new_config('iso') pycone._print_log(choice + 1, stage) print("Nothing to do. Exiting") exit() else: _help_quit(choice, pyconeQ.yes_no_list)
import io import os import time import pycone import pyconeQ import configparser import pwd import sys import string ############################################################################### system = pycone._os_prober(pycone._master_seed('')) def _q_base_system(): system = pycone._os_prober(pycone._master_seed('')) stage = 'rsync' pycone._print_log('', stage)## c_system = str.capitalize(system) choice = pycone._choose_from(pyconeQ.yes_no_list, pyconeQ.which_system % c_system) # return the users choice pycone._print_log(pyconeQ.yes_no_list, stage) pycone._print_log(choice + 1, stage) if choice == 0: # choose a backup of current system pycone._print_log(choice + 1, stage) #pycone._rsync_live(seed)