dwave.cloud.config.get_configfile_paths

get_configfile_paths(system=True, user=True, local=True, only_existing=True)[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 (boolean, default=True) – Search for system-wide configuration files.
  • user (boolean, default=True) – Search for user-local configuration files.
  • local (boolean, default=True) – Search for local configuration files (in CWD).
  • only_existing (boolean, default=True) – Return only paths for files that exist on the local system.
Returns:

List of configuration file paths.

Return type:

list[str]

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.

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