How to use the xdg.BaseDirectory.load_config_paths function in xdg

To help you get started, we’ve selected a few xdg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Cloudef / buildhck / buildhck / config.py View on Github external
def load():
    for config_path in BaseDirectory.load_config_paths('buildhck', 'config.yaml'):
        with open(config_path) as f:
            obj = yaml.load(f)
            if obj:
                config.update(obj)
    if not path.isdir(build_directory()):
        makedirs(build_directory())
github kupferlauncher / kupfer / kupfer / config.py View on Github external
def get_config_files(filename):
    """
    Iterator to @filename in all
    config paths, with most important (takes precendence)
    files first
    """
    return base.load_config_paths(PACKAGE_NAME, filename) or ()
github joeflack4 / just-a-dash / env / Lib / site-packages / wheel / util.py View on Github external
def load_config_paths(*resource):
        import xdg.BaseDirectory
        return xdg.BaseDirectory.load_config_paths(*resource)
github qsniyg / rssit / rssit / config.py View on Github external
def get_config_paths(appname, filename):
    paths = reversed(list(xdg.BaseDirectory.load_config_paths(appname)))

    config_paths = []

    for path in paths:
        config_paths.append(os.path.join(path, filename))

    return config_paths
github dheerajchand / ubuntu-django-nginx-ansible / projectenv / lib / python2.7 / site-packages / wheel / util.py View on Github external
def load_config_paths(*resource):
        import xdg.BaseDirectory
        return xdg.BaseDirectory.load_config_paths(*resource)
github ju1ius / uxdgmenu / usr / lib / uxdgmenu / uxm / dialogs / editor / treemodel.py View on Github external
def lookup_menu_files(filename):
    return [f for f in xdg.BaseDirectory.load_config_paths('menus/' + filename)]
github agateau / mup / mup / config.py View on Github external
def load():
    dct = {}
    for filepath in BaseDirectory.load_config_paths("mup/mup.yaml"):
        with open(filepath) as f:
            try:
                dct.update(yaml.load(f))
            except Exception as exc:
                logging.exception("Failed to load {}, skipping it.".format(filepath))

    return dct
github ptpb / pb / pb / config.py View on Github external
def load_config(app, filename):
    config.clear()
    for filename in BaseDirectory.load_config_paths('pb', filename):
        with open(filename) as f:
            obj = yaml.load(f)
            config.update(obj)
    if app:
        app.config.from_mapping(config)
    return config
github timbertson / supergenpass / platform / supergenpass_platform / persistence.py View on Github external
def _read(self):
		self._save = self._save_xdg
		for d in BaseDirectory.load_config_paths(CONFIG):
			path = os.path.join(d, DOMAINS)
			if os.path.exists(path):
				return self._read_file(path)
		else:
			return {}