'Initialize a callable WSGI instance.
Config parameter can be a file path string for a JSON configuration
file or a configuration object with \'cache\', \'layers\', and
\'dirpath\' properties.
Optional autoreload boolean parameter causes config to be re-read
on each request, applicable only when config is a JSON file.'

def __init__(self, config, autoreload=False):

    if (type(config) in (str, unicode, dict)):
        self.autoreload = autoreload
        self.config_path = config
        try:
            self.config = parseConfig(config)
        except:
            print('Error    loading    Tilestache    config:')
            raise
    else:
        assert hasattr(config, 'cache'), 'Configuration    object    must    have    a    cache.'
        assert hasattr(config, 'layers'), 'Configuration    object    must    have    layers.'
        assert hasattr(config, 'dirpath'), 'Configuration    object    must    have    a    dirpath.'
        self.autoreload = False
        self.config_path = None
        self.config = config
