--- a/server/sources/datafeed.py Tue Aug 02 15:52:42 2011 +0200
+++ b/server/sources/datafeed.py Tue Aug 02 10:39:10 2011 +0200
@@ -351,10 +351,10 @@
def parse(self, url):
if url.startswith('http'):
- from cubicweb.sobjects.parsers import HOST_MAPPING
- for mappedurl in HOST_MAPPING:
+ from cubicweb.sobjects.parsers import URL_MAPPING
+ for mappedurl in URL_MAPPING:
if url.startswith(mappedurl):
- url = url.replace(mappedurl, HOST_MAPPING[mappedurl], 1)
+ url = url.replace(mappedurl, URL_MAPPING[mappedurl], 1)
break
self.source.info('GET %s', url)
stream = _OPENER.open(url)
--- a/sobjects/parsers.py Tue Aug 02 15:52:42 2011 +0200
+++ b/sobjects/parsers.py Tue Aug 02 10:39:10 2011 +0200
@@ -459,10 +459,10 @@
def registration_callback(vreg):
vreg.register_all(globals().values(), __name__)
- global HOST_MAPPING
- HOST_MAPPING = {}
+ global URL_MAPPING
+ URL_MAPPING = {}
if vreg.config.apphome:
- host_mapping_file = osp.join(vreg.config.apphome, 'hostmapping.py')
- if osp.exists(host_mapping_file):
- HOST_MAPPING = eval(file(host_mapping_file).read())
- vreg.info('using host mapping %s from %s', HOST_MAPPING, host_mapping_file)
+ url_mapping_file = osp.join(vreg.config.apphome, 'urlmapping.py')
+ if osp.exists(url_mapping_file):
+ URL_MAPPING = eval(file(url_mapping_file).read())
+ vreg.info('using url mapping %s from %s', URL_MAPPING, url_mapping_file)