Пример #1
0
def newform(project):

    folder = project.folder
    foldername = newfoldername("form", folder, "Form")

    formfolder = os.path.join(folder, foldername)
    templateform = os.path.join(templatefolder, "templateform")
    shutil.copytree(templateform, formfolder)

    config = dict(label='New Form', type='auto', widgets=[])
    form = project.addformconfig(foldername, config)
    return form
Пример #2
0
def create_form(project, name):
    folder = project.folder

    formfolder = os.path.join(folder, name)
    templateform = os.path.join(templatefolder, "templateform")
    shutil.copytree(templateform, formfolder)

    config = dict(label=name, type='auto', widgets=[])
    form = project.addformconfig(name, config)
    logger.debug(form.settings)
    logger.debug(form.settings == config)
    return form
Пример #3
0
def newform(project):

    folder = project.folder
    foldername = newfoldername("form", folder, "Form")

    formfolder = os.path.join(folder, foldername)
    templateform = os.path.join(templatefolder, "templateform")
    shutil.copytree(templateform, formfolder)

    config = dict(label=foldername, type="auto", widgets=[])
    form = project.addformconfig(foldername, config)
    logger.debug(form.settings)
    logger.debug(form.settings == config)
    return form