def __init__(self, app, manifests, package_dir={},
                 error_status='200 OK'):
        if not callable(app):
            raise TypeError('app must be a WSGI-compliant callable object, '
                            'not ' + repr(app))
        self.app = app
        self.manifests = Manifest.normalize_manifests(manifests)
        if not isinstance(package_dir, collections.Mapping):
            raise TypeError('package_dir must be a mapping object, not ' +
                            repr(package_dir))
        self.error_status = error_status
        self.package_dir = dict(package_dir)
        for package_name in self.manifests:
            if package_name in self.package_dir:
                continue
            path = resource_filename(package_name, '')
            self.package_dir[package_name] = path
        self.paths = []
        for package_name, manifest in self.manifests.items():
            wsgi_path = manifest.wsgi_path
            if not wsgi_path.startswith('/'):
                wsgi_path = '/' + wsgi_path
            if not wsgi_path.endswith('/'):
                wsgi_path += '/'
            package_dir = self.package_dir[package_name]
            self.paths.append((wsgi_path, package_dir, manifest))
dataset/ETHPy150Open dahlia/libsass-python/sassutils/wsgi.py/SassMiddleware.__init__/original