コード例 #1
0
def get_file_path(module, dt, dn):
    dt, dn = scrub_dt_dn(dt, dn)

    path = os.path.join(get_module_path(module),
                        os.path.join(dt, dn, dn + ".json"))

    return path
コード例 #2
0
ファイル: import_file.py プロジェクト: ESS-LLP/frappe
def get_file_path(module, dt, dn):
	dt, dn = scrub_dt_dn(dt, dn)

	path = os.path.join(get_module_path(module),
		os.path.join(dt, dn, dn + ".json"))

	return path
コード例 #3
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)

    frappe.create_folder(folder)

    # create init_py_files
    if create_init:
        create_init_py(module_path, dt, dn)

    return folder
コード例 #4
0
ファイル: export_file.py プロジェクト: aboganas/frappe
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)

	frappe.create_folder(folder)

	# create init_py_files
	if create_init:
		create_init_py(module_path, dt, dn)

	return folder
コード例 #5
0
ファイル: data_migration_plan.py プロジェクト: ESS-LLP/frappe
	def on_update(self):
		# update custom fields in mappings
		self.make_custom_fields_for_mappings()

		if frappe.flags.in_import or frappe.flags.in_test:
			return

		if frappe.local.conf.get('developer_mode'):
			record_list =[['Data Migration Plan', self.name]]

			for m in self.mappings:
				record_list.append(['Data Migration Mapping', m.mapping])

			export_to_files(record_list=record_list, record_module=self.module)

			for m in self.mappings:
				dt, dn = scrub_dt_dn('Data Migration Mapping', m.mapping)
				create_init_py(get_module_path(self.module), dt, dn)
コード例 #6
0
    def on_update(self):
        # update custom fields in mappings
        self.make_custom_fields_for_mappings()

        if frappe.flags.in_import or frappe.flags.in_test:
            return

        if frappe.local.conf.get('developer_mode'):
            record_list = [['Data Migration Plan', self.name]]

            for m in self.mappings:
                record_list.append(['Data Migration Mapping', m.mapping])

            export_to_files(record_list=record_list, record_module=self.module)

            for m in self.mappings:
                dt, dn = scrub_dt_dn('Data Migration Mapping', m.mapping)
                create_init_py(get_module_path(self.module), dt, dn)
コード例 #7
0
def create_folder(module, dt, dn, create_init):
    if frappe.db.get_value('Module Def', module, 'custom'):
        module_path = get_custom_module_path(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)

    frappe.create_folder(folder)

    # create init_py_files
    if create_init:
        create_init_py(module_path, dt, dn)

    return folder