mambo/controller.py
def run(args):
    """
    Executes the correct action according the user input.

    Parameters:
        args - arguments collected by argparser
    """
    # Declares an instance of SetupSimulator()
    setup = SetupSimulator()
    if args.install:
        # Cleanup the screen
        setup.clear()
        # Get the moment when the installation started
        start_time = time.time()
        # Check internet connection
        if not setup.is_connected_internet():
            print "Ensure you have internet connection"
            sys.exit(1)
        # Pretty print an initial message
        setup.pretty_print("Installing")
        # Check and install missing dependencies.
        setup.verify_dependencies()
        # Create a directory where all packages will be stored.
        create_directory(var.DOWNLOAD_DIR, setup)
        # Download and show the license
        download_license(var.LICENSES, var.DOWNLOAD_DIR, setup)
        # Continue the installation process only if the user
        # agreed with the license.
        if setup.read_license():
            download_common_pckg(var.COMMON_FILES, var.DOWNLOAD_DIR, setup)
            download_by_distro(setup.get_distro(), var.DIR_PATH,
                               var.DOWNLOAD_DIR, setup)
            setup.check_sum(var.DOWNLOAD_DIR)
            install_packages(var.VERSIONS, var.DOWNLOAD_DIR, setup)
            extract_img(var.DISK, var.DOWNLOAD_DIR, setup)
            # customize_img(var.DISK, var.LOCKFILE, var.MOUNT_POINT,
            #               var.DOWNLOAD_DIR, setup)
            create_symlink(var.DISK_SYM_LINK, var.DISK, var.DOWNLOAD_DIR,
                           setup)
            if setup.cmd_exists('mambo'):
                setup.execute_cmd('mambo --help')
        print "Execution time: %s seconds." % (time.time() - start_time)
    elif args.start:
        try:
            start_simulator(args.start, setup)
        except (KeyboardInterrupt, SystemExit, RuntimeError):
            exit(1)

    Executes the correct action according the user input.

    Parameters:
        args - arguments collected by argparser
    
Executes the correct action according the user input.
Parameters:
args - arguments collected by argparser
Executes the correct action according the user input . Parameters : args - arguments collected by argparser
def run(args):
    setup = SetupSimulator()
    if args.install:
        setup.clear()
        start_time = time.time()
        if not setup.is_connected_internet():
            print "Ensure you have internet connection"
            sys.exit(1)
        setup.pretty_print("Installing")
        setup.verify_dependencies()
        create_directory(var.DOWNLOAD_DIR, setup)
        download_license(var.LICENSES, var.DOWNLOAD_DIR, setup)
        if setup.read_license():
            download_common_pckg(var.COMMON_FILES, var.DOWNLOAD_DIR, setup)
            download_by_distro(setup.get_distro(), var.DIR_PATH,
                               var.DOWNLOAD_DIR, setup)
            setup.check_sum(var.DOWNLOAD_DIR)
            install_packages(var.VERSIONS, var.DOWNLOAD_DIR, setup)
            extract_img(var.DISK, var.DOWNLOAD_DIR, setup)
            create_symlink(var.DISK_SYM_LINK, var.DISK, var.DOWNLOAD_DIR,
                           setup)
            if setup.cmd_exists('mambo'):
                setup.execute_cmd('mambo --help')
        print "Execution time: %s seconds." % (time.time() - start_time)
    elif args.start:
        try:
            start_simulator(args.start, setup)
        except (KeyboardInterrupt, SystemExit, RuntimeError):
            exit(1)
def run ( args ) : setup = SetupSimulator ( ) if args . install : setup . clear ( ) start_time = time . time ( ) if not setup . is_connected_internet ( ) : print "Ensure you have internet connection" sys . exit ( 1 ) setup . pretty_print ( "Installing" ) setup . verify_dependencies ( ) create_directory ( var . DOWNLOAD_DIR , setup ) download_license ( var . LICENSES , var . DOWNLOAD_DIR , setup ) if setup . read_license ( ) : download_common_pckg ( var . COMMON_FILES , var . DOWNLOAD_DIR , setup ) download_by_distro ( setup . get_distro ( ) , var . DIR_PATH , var . DOWNLOAD_DIR , setup ) setup . check_sum ( var . DOWNLOAD_DIR ) install_packages ( var . VERSIONS , var . DOWNLOAD_DIR , setup ) extract_img ( var . DISK , var . DOWNLOAD_DIR , setup ) create_symlink ( var . DISK_SYM_LINK , var . DISK , var . DOWNLOAD_DIR , setup ) if setup . cmd_exists ( 'mambo' ) : setup . execute_cmd ( 'mambo --help' ) print "Execution time: %s seconds." % ( time . time ( ) - start_time ) elif args . start : try : start_simulator ( args . start , setup ) except ( KeyboardInterrupt , SystemExit , RuntimeError ) : exit ( 1 )
Executes the correct action according the user input.
Executes the correct action according the user input .
"""
    Executes the correct action according the user input.

    Parameters:
        args - arguments collected by argparser
    """ # Declares an instance of SetupSimulator() # Cleanup the screen # Get the moment when the installation started # Check internet connection # Pretty print an initial message # Check and install missing dependencies. # Create a directory where all packages will be stored. # Download and show the license # Continue the installation process only if the user # agreed with the license. # customize_img(var.DISK, var.LOCKFILE, var.MOUNT_POINT, #               var.DOWNLOAD_DIR, setup)
args