예제 #1
0
def setup_global_help(db_type=None, root_password=None):
	'''setup help table in a separate database that will be
	shared by the whole bench and set `global_help_setup` as 1 in
	common_site_config.json'''

	from frappe.installer import update_site_config

	frappe.local.flags = frappe._dict()
	frappe.local.flags.in_setup_help = True
	frappe.local.flags.in_install = True
	frappe.local.lang = 'en'
	frappe.local.conf = frappe.get_site_config(sites_path='.')

	update_site_config('global_help_setup', 1,
		site_config_path=os.path.join('.', 'common_site_config.json'))

	if root_password:
		frappe.local.conf.root_password = root_password

	if not frappe.local.conf.db_type:
		frappe.local.conf.db_type = db_type


	from frappe.utils.help import sync
	sync()
예제 #2
0
def setup_help(context):
	'''Setup help table in the current site (called after migrate)'''
	from frappe.utils.help import sync

	for site in context.sites:
		try:
			frappe.init(site)
			frappe.connect()
			sync()
		finally:
			frappe.destroy()
예제 #3
0
def setup_help(context):
	'''Setup help table in the current site (called after migrate)'''
	from frappe.utils.help import sync

	for site in context.sites:
		try:
			frappe.init(site)
			frappe.connect()
			sync()
		finally:
			frappe.destroy()
예제 #4
0
def setup_global_help(mariadb_root_password=None):
	'''setup help table in a separate database that will be
	shared by the whole bench and set `global_help_setup` as 1 in
	common_site_config.json'''

	from frappe.installer import update_site_config

	frappe.local.flags = frappe._dict()
	frappe.local.flags.in_setup_help = True
	frappe.local.flags.in_install = True
	frappe.local.lang = 'en'
	frappe.local.conf = frappe.get_site_config(sites_path='.')

	update_site_config('global_help_setup', 1,
		site_config_path=os.path.join('.', 'common_site_config.json'))

	if mariadb_root_password:
		frappe.local.conf.root_password = mariadb_root_password

	from frappe.utils.help import sync
	sync()