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
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
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