Beispiel #1
0
def create( args, options ):
    fe_chain = format.fe_chain( args )
    modules_names = args[1:]

    if ( check.is_file_exists( '__init__.js', options ) == False ):
        create_new( fe_chain, modules_names )
        if ( options.verbose_flag != False ):
            print colorama.Fore.GREEN + '__init__.js created: ',
    else:
        append_to_existed( fe_chain, modules_names, options )

    if ( options.verbose_flag != False ):
        print os.path.abspath( '__init__.js' ) + colorama.Fore.RESET
Beispiel #2
0
def create( args, options ):
    fe_chain = format.fe_chain( args )
    modules_names = args[1:]
    names_lng = len( modules_names )

    if ( names_lng == 0 ):
        if ( options.verbose_flag != False ):
            print 'Info: No module names were passed'
        return

    for module_name in modules_names:
        methods = module_name.split(':')[1:]
        module_name = module_name.split(':')[0]
        module_name = format.name( 'lower', module_name )

        if ( check.is_file_exists( module_name+'.js', options ) == False ):
            write_file( fe_chain, module_name, methods, options )
Beispiel #3
0
def run( args, settings_passed, options, operators ):
    if ( options.verbose_flag != False ):
        print 'Module: FE creator'
        print '------------------'

    argslen = len( args )
    check.if_arguments_passed( argslen )

    try:
        fe = args[0].split('.')[0]
        fe_names = format.fe_chain( args ).split('.')
        fes = fe_names[1:]    # modules
    except:
        print "ERROR: Cannot find FE names. Exiting.\n"
        sys.exit(0)

    if ( len(fes) < 1 ):
        print "ERROR: Cannot find FE names. Exiting.\n"
        sys.exit(0)

    if ( fe not in operators ):
        print "ERROR: Cannot recognize '" + fe + "' operator. Exiting.\n"
        sys.exit(2)

    create_if_doesnt_exist_and_open( fe )   # pages || repo || widget
    create_directories( fes )  # Google.Map

    #fe_name = fe_name[0].capitalize() + fe_name[1:]
    #check.for_name_conflicts( fe_name )

    init.create( args, options )
    modules.create( args, options )

    links.controller.handle_links( settings_passed, os.getcwd() )

    if ( options.verbose_flag != False ):
        print "Info: " + '.'.join( fes ) + " was successfully created. All needed links can be found in '__links__' file."