Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minimal cleanup and documentation for prepareKeywordArgs() provider m…

…ethods
  • Loading branch information...
commit 30a06a86d3d91a0d37ecc3f990cf009f1e67ea19 1 parent 57f7d2b
migurski migurski authored
5 TileStache/Config.py
View
@@ -420,10 +420,7 @@ def _parseConfigfileLayer(layer_dict, config, dirpath):
if 'name' in provider_dict:
_class = Providers.getProviderByName(provider_dict['name'])
- provider_kwargs = {}
-
- if hasattr(_class, 'prepareKeywordArgs'):
- provider_kwargs.update(_class.prepareKeywordArgs(provider_dict))
+ provider_kwargs = _class.prepareKeywordArgs(provider_dict)
elif 'class' in provider_dict:
_class = loadClassPath(provider_dict['class'])
4 TileStache/MBTiles.py
View
@@ -207,8 +207,8 @@ def __init__(self, layer, tileset):
@staticmethod
def prepareKeywordArgs(config_dict):
- '''
- '''
+ """ Convert configured parameters to keyword args for __init__().
+ """
return {'tileset': config_dict['tileset']}
def renderTile(self, width, height, srs, coord):
8 TileStache/Mapnik.py
View
@@ -92,8 +92,8 @@ def __init__(self, layer, mapfile, fonts=None):
@staticmethod
def prepareKeywordArgs(config_dict):
- '''
- '''
+ """ Convert configured parameters to keyword args for __init__().
+ """
kwargs = {'mapfile': config_dict['mapfile']}
if 'fonts' in config_dict:
@@ -217,8 +217,8 @@ def __init__(self, layer, mapfile, fields=None, layers=None, layer_index=0, scal
@staticmethod
def prepareKeywordArgs(config_dict):
- '''
- '''
+ """ Convert configured parameters to keyword args for __init__().
+ """
kwargs = {'mapfile': config_dict['mapfile']}
for key in ('fields', 'layers', 'layer_index', 'scale', 'layer_id_key'):
8 TileStache/Providers.py
View
@@ -176,8 +176,8 @@ def __init__(self, layer, url=None, provider_name=None):
@staticmethod
def prepareKeywordArgs(config_dict):
- '''
- '''
+ """ Convert configured parameters to keyword args for __init__().
+ """
kwargs = dict()
if 'url' in config_dict:
@@ -248,8 +248,8 @@ def __init__(self, layer, template, referer=None):
@staticmethod
def prepareKeywordArgs(config_dict):
- '''
- '''
+ """ Convert configured parameters to keyword args for __init__().
+ """
kwargs = {'template': config_dict['template']}
if 'referer' in config_dict:
4 TileStache/Sandwich.py
View
@@ -145,8 +145,8 @@ def __init__(self, layer, stack):
@staticmethod
def prepareKeywordArgs(config_dict):
- '''
- '''
+ """ Convert configured parameters to keyword args for __init__().
+ """
return {'stack': config_dict['stack']}
def renderTile(self, width, height, srs, coord):
4 TileStache/Vector/__init__.py
View
@@ -553,8 +553,8 @@ def __init__(self, layer, driver, parameters, clipped, verbose, projected, spaci
@staticmethod
def prepareKeywordArgs(config_dict):
- '''
- '''
+ """ Convert configured parameters to keyword args for __init__().
+ """
kwargs = dict()
kwargs['driver'] = config_dict['driver']
Please sign in to comment.
Something went wrong with that request. Please try again.