dwave.cloud.config.get_configfile_paths#

get_configfile_paths(*, system: bool = True, user: bool = True, local: bool = True, only_existing: bool = True, app_author: str = 'dwavesystem', app_name: str = 'dwave', filename: str = 'dwave.conf') list[str][source]#

Return a list of local configuration file paths.

Search paths for configuration files on the local system are based on homebase and depend on operating system; for example, for Linux systems these might include dwave.conf in the current working directory (CWD), user-local .config/dwave/, and system-wide /etc/dwave/.

Parameters:
  • system – Search for system-wide configuration files.

  • user – Search for user-local configuration files.

  • local – Search for local configuration files (in CWD).

  • only_existing – Return only paths for files that exist on the local system.

  • app_author – Application author, used by homebase to determine config file paths.

  • app_name – Application name, used by homebase to determine config file paths.

  • filename – Configuration filename.

Returns:

List of configuration file paths.

Examples

This example displays all paths to configuration files on a Windows system running Python 2.7 and then finds the single existing configuration file.

>>> from dwave.cloud.config import get_configfile_paths
>>> # Display paths
>>> get_configfile_paths(only_existing=False)   
['C:\ProgramData\dwavesystem\dwave\dwave.conf',
 'C:\Users\jane\AppData\Local\dwavesystem\dwave\dwave.conf',
 '.\dwave.conf']
>>> # Find existing files
>>> get_configfile_paths()   
['C:\Users\jane\AppData\Local\dwavesystem\dwave\dwave.conf']