mambo/controller.py
def download_by_distro(distro, dir_path, download_directory, setup_simulator):
    '''
    Download the necessary packages by distro.
    '''
    if var.UBUNTU in distro:
        dfile = dir_path + "/resources/distros/ubuntu.config"
    elif var.FEDORA in distro:
        dfile = dir_path + "/resources/distros/fedora.config"
    else:
        dfile = dir_path + "/resources/distros/suserhelcentos.config"
    with open(dfile) as fdownload:
        packages = fdownload.readlines()
        size = len(packages)
        for pkg in range(size):
            sim_package = packages[pkg].split("/")[-1]
            fname = download_directory + "/" + sim_package.strip('\n')
            if not setup_simulator.file_exists(fname):
                print " * Downloading " + sim_package.strip('\n')
                setup_simulator.download(packages[pkg],
                                         sim_package.strip('\n'),
                                         download_directory)

    Download the necessary packages by distro.
    
Download the necessary packages by distro.
Download the necessary packages by distro .
def download_by_distro(distro, dir_path, download_directory, setup_simulator):
    if var.UBUNTU in distro:
        dfile = dir_path + "/resources/distros/ubuntu.config"
    elif var.FEDORA in distro:
        dfile = dir_path + "/resources/distros/fedora.config"
    else:
        dfile = dir_path + "/resources/distros/suserhelcentos.config"
    with open(dfile) as fdownload:
        packages = fdownload.readlines()
        size = len(packages)
        for pkg in range(size):
            sim_package = packages[pkg].split("/")[-1]
            fname = download_directory + "/" + sim_package.strip('\n')
            if not setup_simulator.file_exists(fname):
                print " * Downloading " + sim_package.strip('\n')
                setup_simulator.download(packages[pkg],
                                         sim_package.strip('\n'),
                                         download_directory)
def download_by_distro ( distro , dir_path , download_directory , setup_simulator ) : if var . UBUNTU in distro : dfile = dir_path + "/resources/distros/ubuntu.config" elif var . FEDORA in distro : dfile = dir_path + "/resources/distros/fedora.config" else : dfile = dir_path + "/resources/distros/suserhelcentos.config" with open ( dfile ) as fdownload : packages = fdownload . readlines ( ) size = len ( packages ) for pkg in range ( size ) : sim_package = packages [ pkg ] . split ( "/" ) [ - 1 ] fname = download_directory + "/" + sim_package . strip ( '\n' ) if not setup_simulator . file_exists ( fname ) : print " * Downloading " + sim_package . strip ( '\n' ) setup_simulator . download ( packages [ pkg ] , sim_package . strip ( '\n' ) , download_directory )
Download the necessary packages by distro.
Download the necessary packages by distro .
'''
    Download the necessary packages by distro.
    '''
distro
dir_path
download_directory
setup_simulator