Пример #1
0
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)
Пример #2
0
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)
Пример #3
0
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
Пример #4
0
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
Пример #5
0
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
Пример #6
0
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
Пример #7
0
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
Пример #8
0
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
Пример #9
0
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