Skip to content

Instantly share code, notes, and snippets.

@Daviey

Daviey/- Secret

Created July 30, 2015 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daviey/6edf198a996ba55a0167 to your computer and use it in GitHub Desktop.
Save Daviey/6edf198a996ba55a0167 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import os
from appdirs import site_config_dir
from appdirs import user_config_dir
BASE_CONFIG = '/bandit.yaml'
os.environ['XDG_CONFIG_DIRS'] = '/etc:/usr/local/etc'
config_dirs = (['.'] + [user_config_dir("bandit")] +
site_config_dir("bandit", multipath=True).split(':'))
config_locations = [s + BASE_CONFIG for s in config_dirs]
print config_locations
@Daviey
Copy link
Author

Daviey commented Jul 30, 2015

Ubuntu:
['./bandit.yaml', '/home/dave/.config/bandit/bandit.yaml', '/etc/bandit/bandit.yaml', '/usr/local/etc/bandit/bandit.yaml']

Mac:
['./bandit.yaml', '/Users/mike/Library/Application Support/bandit/bandit.yaml', '/Library/Application Support/bandit/bandit.yaml'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment