def install_drivers(drivers): make_message('section_title', 'DRIVERS') make_message('app_lists', drivers.keys()) ret = [] if 'intel-graphic' in drivers.keys(): try: subprocess.check_call(install_testing_cmd.format(drivers['intel-graphic']), shell=True) except Exception as e: make_message('error', PHASES['install']['fct'], 'intel-graphic', e) ret.append('intel-graphic') if 'intel-wifi' in drivers.keys(): try: subprocess.check_call(install_backports_cmd.format(drivers['intel-wifi']), shell=True) except Exception as e: make_message('error', PHASES['install']['fct'], 'intel-wifi', e) ret.append('intel-wifi') if 'nvidia-graphic' in drivers.keys() : cmd = 'aptitude -r -y install linux-headers-$(uname -r|sed \'s,[^-]*-[^-]*-,,\') nvidia-kernel-dkms nvidia-xconfig' try: subprocess.check_call(cmd, shell=True) subprocess.check_call('nvidia-xconfig',shell=True) except Exception as e: make_message('error', PHASES['install']['fct'], 'nvidia-graphic', e) ret.append('nvidia-graphic') if 'ati-graphic' in drivers.keys() : try: subprocess.check_call(install_cmd.format(drivers['ati-graphic']), shell=True) except Exception as e: make_message('error', PHASES['install']['fct'], 'ati-graphic', e) ret.append('ati-graphic') return ret
def postgresql_install(postgres_apps): make_message('section_title', 'POSTGRES_REPO') make_message('app_lists', postgres_apps.keys()) try: subprocess.check_call(install_cmd.format(' '.join(list(postgres_apps.values()))), shell=True) subprocess.check_call('sudo su - postgres -c "createuser -s $USER"',shell=True) except Exception as e: make_message('error', PHASES['install']['title'], 'dépendences postgres', e)
def install_media(media_apps): make_message('section_title', 'MEDIA') make_message('app_lists', media_apps.keys()) try: subprocess.check_call(install_cmd.format(' '.join(list(media_apps.values()))), shell=True) except Exception as e: make_message('error', PHASES['install']['title'], 'dépendences média', e) return 1 return 0
def base_install(base_apps): make_message('section_title', 'BASE') make_message('app_lists', base_apps.keys()) cmd = install_cmd.format(' '.join(list(base_apps.values()))) try: subprocess.check_call(cmd, shell=True) except Exception as e: make_message('error', PHASES['install']['fct'], 'des dépendences de base', e) exit(1)
def python_install(python_apps): make_message('section_title', 'PYTHON') make_message('app_lists', python_apps.keys()) try: python_apps_cmd = install_cmd.format(' '.join(list(python_apps.values()))) subprocess.check_call(python_apps_cmd, shell=True) except Exception as e: make_message('error', PHASES['install']['fct'], 'des dépendences python', e) exit(1)
def python_install(python_apps): make_message('section_title', 'PYTHON') make_message('app_lists', python_apps.keys()) try: python_apps_cmd = install_cmd.format(' '.join( list(python_apps.values()))) subprocess.check_call(python_apps_cmd, shell=True) except Exception as e: make_message('error', PHASES['install']['fct'], 'des dépendences python', e) exit(1)
def install_media(media_apps): make_message('section_title', 'MEDIA') make_message('app_lists', media_apps.keys()) try: subprocess.check_call(install_cmd.format(' '.join( list(media_apps.values()))), shell=True) except Exception as e: make_message('error', PHASES['install']['title'], 'dépendences média', e) return 1 return 0
def postgresql_install(postgres_apps): make_message('section_title', 'POSTGRES_REPO') make_message('app_lists', postgres_apps.keys()) try: subprocess.check_call(install_cmd.format(' '.join( list(postgres_apps.values()))), shell=True) subprocess.check_call('sudo su - postgres -c "createuser -s $USER"', shell=True) except Exception as e: make_message('error', PHASES['install']['title'], 'dépendences postgres', e)
def install_drivers(drivers): make_message('section_title', 'DRIVERS') make_message('app_lists', drivers.keys()) ret = [] if 'intel-graphic' in drivers.keys(): try: subprocess.check_call(install_testing_cmd.format( drivers['intel-graphic']), shell=True) except Exception as e: make_message('error', PHASES['install']['fct'], 'intel-graphic', e) ret.append('intel-graphic') if 'intel-wifi' in drivers.keys(): try: subprocess.check_call(install_backports_cmd.format( drivers['intel-wifi']), shell=True) except Exception as e: make_message('error', PHASES['install']['fct'], 'intel-wifi', e) ret.append('intel-wifi') if 'nvidia-graphic' in drivers.keys(): cmd = 'aptitude -r -y install linux-headers-$(uname -r|sed \'s,[^-]*-[^-]*-,,\') nvidia-kernel-dkms nvidia-xconfig' try: subprocess.check_call(cmd, shell=True) subprocess.check_call('nvidia-xconfig', shell=True) except Exception as e: make_message('error', PHASES['install']['fct'], 'nvidia-graphic', e) ret.append('nvidia-graphic') if 'ati-graphic' in drivers.keys(): try: subprocess.check_call(install_cmd.format(drivers['ati-graphic']), shell=True) except Exception as e: make_message('error', PHASES['install']['fct'], 'ati-graphic', e) ret.append('ati-graphic') return ret