parser = ArgumentParser(
        description = 'update your local copy of code template using your config.py file'
    )

    parser.add_argument(
        '-i',
        '--install-dir',
        nargs='?',
        help = 'Path where you have installed cppcmsskel',
        default = CPPCMS_SKEL_DEFAULT_INSTALL_DIR
    )
    args = parser.parse_args();
    cppcmsskelInstallDir = args.install_dir

    if (os.path.isdir(LOCAL_TEMPLATE_ROOT)):
        shutil.rmtree(LOCAL_TEMPLATE_ROOT)

    # we generate a local copy of the template files ...
    create_template_local_copy(
        cppcmsskelInstallDir + 'template',
        LOCAL_TEMPLATE_ROOT
    )

    # and we adapt them to fit the current application
    adapt_files(
        LOCAL_TEMPLATE_ROOT,
        REPLACEMENTS,
        IGNORE_DIRS,
        IGNORE_EXTENSIONS
    )
Esempio n. 2
0
    )
    args = parser.parse_args();
    cppcmsskelInstallDir = args.install_dir




    # we create the application directory
    os.mkdir(APP_ROOT)
    
    # we create the directory structure in it
    generate_folders(APP_ROOT,FOLDERS)
    
    # we generate a local copy of the template files ...
    create_template_local_copy(
        CPPCMS_SKEL_DEFAULT_INSTALL_DIR + 'template',
        LOCAL_TEMPLATE_ROOT
    )
    
    # and we adapt them to fit the current application
    adapt_files(
        LOCAL_TEMPLATE_ROOT,
        REPLACEMENTS,
        IGNORE_DIRS,
        IGNORE_EXTENSIONS
    )

    # we move the needing files from the local template
    # directory to the application's one
    move_and_renamed_files(
        LOCAL_TEMPLATE_ROOT,
        APP_ROOT,
Esempio n. 3
0
    parser.add_argument('-i',
                        '--install-dir',
                        nargs='?',
                        help='Path where you have installed cppcmsskel',
                        default=CPPCMS_SKEL_DEFAULT_INSTALL_DIR)
    args = parser.parse_args()
    cppcmsskelInstallDir = args.install_dir

    # we create the application directory
    os.mkdir(APP_ROOT)

    # we create the directory structure in it
    generate_folders(APP_ROOT, FOLDERS)

    # we generate a local copy of the template files ...
    create_template_local_copy(CPPCMS_SKEL_DEFAULT_INSTALL_DIR + 'template',
                               LOCAL_TEMPLATE_ROOT)

    # and we adapt them to fit the current application
    adapt_files(LOCAL_TEMPLATE_ROOT, REPLACEMENTS, IGNORE_DIRS,
                IGNORE_EXTENSIONS)

    # we move the needing files from the local template
    # directory to the application's one
    move_and_renamed_files(LOCAL_TEMPLATE_ROOT, APP_ROOT, REPLACEMENTS,
                           MAIN_APP_PLACEHOLDER)
    print('''
        ################################
        NOW WE GENERATE THE ARCHITECTURE
        ################################
        ''')
    # finally generate the code following the