Skip to content

Commit

Permalink
Adding configuration file's directory to sys.path in Config.buildConf…
Browse files Browse the repository at this point in the history
…iguration()
  • Loading branch information
migurski committed Dec 28, 2011
1 parent d815aa4 commit 8d43b19
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion TileStache/Config.py
Expand Up @@ -46,6 +46,7 @@
documentation for TileStache.Providers, TileStache.Core, and TileStache.Geography.
"""

import sys
from sys import stderr, modules
from os.path import realpath, join as pathjoin
from urlparse import urljoin, urlparse
Expand Down Expand Up @@ -159,8 +160,14 @@ def buildConfiguration(config_dict, dirpath='.'):
The second argument is an optional dirpath that specifies where in the
local filesystem the parsed dictionary originated, to make it possible
to resolve relative paths.
to resolve relative paths. It might be a path or more likely a full
URL including the "file://" prefix.
"""
scheme, h, path, p, q, f = urlparse(dirpath)

if scheme in ('', 'file'):
sys.path.insert(0, path)

cache_dict = config_dict.get('cache', {})
cache = _parseConfigfileCache(cache_dict, dirpath)

Expand Down

0 comments on commit 8d43b19

Please sign in to comment.