def import_file(module, dt, dn, force=False): """Sync a file from txt if modifed, return false if not updated""" dt, dn = scrub_dt_dn(dt, dn) path = os.path.join(get_module_path(module), os.path.join(dt, dn, dn + '.txt')) return import_file_by_path(path, force)
def import_file(module, dt, dn, force=False): """Sync a file from txt if modifed, return false if not updated""" webnotes.flags.in_import = True dt, dn = scrub_dt_dn(dt, dn) path = os.path.join(get_module_path(module), os.path.join(dt, dn, dn + '.txt')) ret = import_file_by_path(path, force) webnotes.flags.in_import = False return ret
def create_folder(module, dt, dn, create_init): module_path = get_module_path(module) dt, dn = scrub_dt_dn(dt, dn) # create folder folder = os.path.join(module_path, dt, dn) webnotes.create_folder(folder) # create init_py_files if create_init: create_init_py(module_path, dt, dn) return folder
def create_folder(module, dt, dn, code_type): # get module path by importing the module module_path = get_module_path(module) dt, dn = scrub_dt_dn(dt, dn) # create folder folder = os.path.join(module_path, dt, dn) webnotes.create_folder(folder) # create init_py_files if code_type: create_init_py(module_path, dt, dn) return folder
def create_folder(module, dt, dn, code_type, plugin=None): if plugin: module_path = os.path.join(get_plugin_path(plugin), scrub(module)) else: module_path = get_module_path(module) dt, dn = scrub_dt_dn(dt, dn) # create folder folder = os.path.join(module_path, dt, dn) webnotes.create_folder(folder) # create init_py_files if code_type: create_init_py(module_path, dt, dn) return folder