예제 #1
0
class formats(object):
    def __init__(self):
        self.normalizer = Formats(GOOGLE_USER, GOOGLE_PASS)
        self.categories = set()

    def __call__(self, client, pkg):
        out_res = []
        for res in pkg.get('resources', []):
            if res.get('format') is not None:
                data = self.normalizer.get(res.get('format'),
                                           source_hint=pkg.get('ckan_url'))
                if data.get('mimetype'):
                    res['format'] = data.get('mimetype')
            out_res.append(res)
        pkg['resources'] = out_res
        return pkg
예제 #2
0
class formats(object):

    def __init__(self):
        self.normalizer = Formats(GOOGLE_USER, GOOGLE_PASS)
        self.categories = set()

    def __call__(self, client, pkg):
        out_res = []
        for res in pkg.get('resources', []):
            if res.get('format') is not None:
                data = self.normalizer.get(res.get('format'),
                                           source_hint=pkg.get('ckan_url'))
                if data.get('mimetype'):
                    res['format'] = data.get('mimetype')
            out_res.append(res)
        pkg['resources'] = out_res
        return pkg
예제 #3
0
 def __init__(self):
     self.normalizer = Formats(GOOGLE_USER, GOOGLE_PASS)
     self.categories = set()
예제 #4
0
 def __init__(self):
     self.normalizer = Formats(GOOGLE_USER, GOOGLE_PASS)
     self.categories = set()