def get_config_path():
if os.environ.get(BUGWARRIORRC):<EOL><INDENT>return os.environ[BUGWARRIORRC]<EOL><DEDENT>xdg_config_home = (<EOL>os.environ.get('<STR_LIT>') or os.path.expanduser('<STR_LIT>'))<EOL>xdg_config_dirs = (<EOL>(os.environ.get('<STR_LIT>') or '<STR_LIT>').split('<STR_LIT::>'))<EOL>paths = [<EOL>os.path.join(xdg_config_home, '<STR_LIT>', '<STR_LIT>'),<EOL>os.path.expanduser("<STR_LIT>")]<EOL>paths += [<EOL>os.path.join(d, '<STR_LIT>', '<STR_LIT>') for d in xdg_config_dirs]<EOL>for path in paths:<EOL><INDENT>if os.path.exists(path):<EOL><INDENT>return path<EOL><DEDENT><DEDENT>return paths[<NUM_LIT:0>]<EOL>
Determine the path to the config file. This will return, in this order of
precedence:
- the value of $BUGWARRIORRC if set
- $XDG_CONFIG_HOME/bugwarrior/bugwarriorc if exists
- ~/.bugwarriorrc if exists
- <dir>/bugwarrior/bugwarriorc if exists, for dir in $XDG_CONFIG_DIRS
- $XDG_CONFIG_HOME/bugwarrior/bugwarriorc otherwise