Esempio n. 1
0
def __edit_dependency__():
    depFile = create_path([emel_project_path(), DEPENDENCY_FILE])
    if not os.path.exists(depFile):
        print 'dependency file not created.'
        print 'please run emel.py dependency -h for more help'
        exit()
    __run_editor__([depFile])
Esempio n. 2
0
def __get_list__():
    the_list = DEFULT
    if check_project_status():
        depFile = create_path([emel_project_path(), DEPENDENCY_FILE])
        if os.path.exists(depFile):
            the_list = []
            with open(depFile, 'r') as f:
                for line in f.readlines():
                    if not line.startswith('#'):
                        line = line.split('#')
                        the_list.append(line[0].strip())
    return the_list
Esempio n. 3
0
def __create_dep_list__(check_first=True):
    if not check_directory_status(True):
        exit()
    if not check_project_status(True):
        exit()
    create = True
    if check_first:
        message = 'Creatint dependency file for project.\n [WARNING] will overrite existing file. Continue?'
        create = yes_no_option(message)

    if create:
        depFile = create_path([emel_project_path(), DEPENDENCY_FILE])
        with open(depFile, 'w') as f:
            f.write('# emel default packages #\n')
            for module in DEFULT:
                f.write(module)
                f.write('\n')
            f.write('# End emel defaults #')