Skip to content

Commit

Permalink
config: look in ~/.config/scrapy.cfg as well
Browse files Browse the repository at this point in the history
  • Loading branch information
nyov committed Mar 24, 2015
1 parent c81eefa commit deb6124
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scrapy/utils/conf.py
Expand Up @@ -5,6 +5,11 @@
import six
from six.moves.configparser import SafeConfigParser

try:
from xdg.BaseDirectory import xdg_config_home
except ImportError:
xdg_config_home = os.path.expanduser('~/.config')


def build_component_list(base, custom):
"""Compose a component list based on a custom and base dict of components
Expand Down Expand Up @@ -64,6 +69,7 @@ def get_config(use_closest=True):

def get_sources(use_closest=True):
sources = ['/etc/scrapy.cfg', r'c:\scrapy\scrapy.cfg',
xdg_config_home + '/scrapy.cfg',
os.path.expanduser('~/.scrapy.cfg')]
if use_closest:
sources.append(closest_scrapy_cfg())
Expand Down

0 comments on commit deb6124

Please sign in to comment.