示例#1
0
 def __init__(self, source_definition):
     super(GegevensmagazijnBaseExtractor,
           self).__init__(source_definition=source_definition)
     user, password = get_secret(self.source_definition['id'])
     self.http_session.headers['Authorization'] = 'Basic %s' % b64encode(
         '%s:%s' % (user, password))
     self.feed_url = self.source_definition['base_url'] + \
                     self.source_definition['feed_query']
示例#2
0
 def run(self, *args, **kwargs):
     item = args[0]
     user, password = get_secret(kwargs['source_definition']['id'])
     self.http_session.headers['Authorization'] = 'Basic %s' % b64encode(
         '%s:%s' % (user, password))
     self.http_session.headers[
         'Accept'] = 'application/xml; charset="utf-8"'
     resp = self.http_session.get(item)
     return 'application/xml', resp.content
示例#3
0
 def __init__(self, source_definition):
     super(GegevensmagazijnBaseExtractor,
           self).__init__(source_definition=source_definition)
     user, password = get_secret(self.source_definition['id'])
     self.http_session.headers['Authorization'] = 'Basic %s' % b64encode(
         '%s:%s' % (user, password))
     self.feed_url = self.source_definition[
         'base_url'] + self.source_definition['feed_query']
     self.redis = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT, db=1)
示例#4
0
 def __init__(self, source_definition):
     super(GegevensmagazijnBaseExtractor, self).__init__(source_definition=source_definition)
     user, password = get_secret(self.source_definition['id'])
     self.http_session.headers['Authorization'] = 'Basic %s' % b64encode('%s:%s' % (user, password))
     self.feed_url = self.source_definition['base_url'] + self.source_definition['feed_query']
     self.redis = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT, db=1)
示例#5
0
 def setup_http_auth(self):
     user, password = get_secret(self.source_definition['id'])
     self.http_session.headers['Authorization'] = 'Basic %s' % b64encode(
         '%s:%s' % (user, password))