def METHOD_NAME(_ignore_test=False):
	'''This method sets the global configuration paths for according to the
	freedesktop basedir specification.
	Called automatically when module is first loaded, should be
	called explicitly only when environment has changed.
	'''
	global ZIM_DATA_DIR
	global XDG_DATA_HOME
	global XDG_DATA_DIRS
	global XDG_CONFIG_HOME
	global XDG_CONFIG_DIRS
	global XDG_CACHE_HOME
	global XDG_TEMPLATES_DIR
	# Cast string to folder
	import zim
	zim_data_dir = LocalFile(zim.ZIM_EXECUTABLE).parent().folder('data')
	if zim_data_dir.exists():
		ZIM_DATA_DIR = zim_data_dir
	if os.name == 'nt':
		APPDATA = os.environ['APPDATA']
		XDG_DATA_HOME = LocalFolder(
			os.environ.get('XDG_DATA_HOME', APPDATA + r'\zim\data').strip())
		XDG_DATA_DIRS = \
			_split_environ_dir_list(os.environ.get('XDG_DATA_DIRS'), ('~/.local/share/',)) # Backwards compatibility
		XDG_CONFIG_HOME = LocalFolder(
			os.environ.get('XDG_CONFIG_HOME', APPDATA + r'\zim\config').strip())
		XDG_CONFIG_DIRS = \
			_split_environ_dir_list(os.environ.get('XDG_CONFIG_DIRS'), ('~/.config/',)) # Backwards compatibility
		XDG_CACHE_HOME = LocalFolder(
			os.environ.get('XDG_CACHE_HOME', APPDATA + r'\zim\cache').strip())
		XDG_TEMPLATES_DIR = LocalFolder(
			os.environ.get('XDG_TEMPLATES_DIR', APPDATA + r'\zim\file_templates').strip())
	else:
		XDG_DATA_HOME = LocalFolder(
			os.environ.get('XDG_DATA_HOME', '~/.local/share/').strip())
		XDG_DATA_DIRS = \
			_split_environ_dir_list(os.environ.get('XDG_DATA_DIRS'), ('/usr/share/', '/usr/local/share/'))
		XDG_CONFIG_HOME = LocalFolder(
			os.environ.get('XDG_CONFIG_HOME', '~/.config/').strip())
		XDG_CONFIG_DIRS = \
			_split_environ_dir_list(os.environ.get('XDG_CONFIG_DIRS'), ('/etc/xdg/',))
		XDG_CACHE_HOME = LocalFolder(
			os.environ.get('XDG_CACHE_HOME', '~/.cache').strip())
		XDG_TEMPLATES_DIR = LocalFolder(
			os.environ.get('XDG_TEMPLATES_DIR', '~/Templates').strip())
			# TODO: we should try to query xdg-user-dirs to get this value, for now at least allow customization via the environment
		if os.environ.get('ZIM_TEST_RUNNING') and not _ignore_test:
			# See tests/__init__.py, we load more folders then we really want
			# because the needs of Gtk, but want to restrict it here for all
			# zim internal use
			XDG_DATA_DIRS = [LocalFolder(os.environ['TEST_XDG_DATA_DIRS'])]