def generate(path, app_model, **kwargs):
    '''
    Generise aplikaciju na zadatoj lokaciji sa zadatim modelom aplikacije.
    '''
    project_app_name = app_model.app_name.replace(' ', '_')
    project_path = os.path.join(path, project_app_name) # root folder na osnovu imena aplikacije (razmak zamenjen sa _)
    
    copy_static_files(project_path, project_app_name, **kwargs)
    renderer.render(project_path, app_model, project_app_name)
Example #2
0
def main():
    '''
    Main method. For available command line arguments see cli.py
    '''
    log_format = '[%(levelname)s] (#%(lineno)s) %(filename)s->%(funcName)s>>> "%(message)s"'
    args = cli.get_args()
    if args.debug:
        logging.basicConfig(format=log_format, level=logging.DEBUG)
    else:
        logging.basicConfig(format=log_format)
    tree = parser.parse(args.url)
    if tree:
        sm = schemamapper.SchemaMapper(tree)
        schemamodel = sm.map()
        cm = classmapper.ClassMapper(schemamodel)
        classmodel = cm.map()
        renderer.render(classmodel, args.dest, args.lang, args.overwrite)
Example #3
0
def main():
    '''
    Main method. For available command line arguments see cli.py
    '''
    log_format = '[%(levelname)s] (#%(lineno)s) %(filename)s->%(funcName)s>>> "%(message)s"'
    args = cli.get_args()
    if args.debug:
        logging.basicConfig(format=log_format, level=logging.DEBUG)
    else:
        logging.basicConfig(format=log_format)
    tree = parser.parse(args.url)
    if tree:
        sm = schemamapper.SchemaMapper(tree)
        schemamodel = sm.map()
        cm = classmapper.ClassMapper(schemamodel)
        classmodel = cm.map()
        renderer.render(classmodel, args.dest, args.lang, args.overwrite)