server/sources/datafeed.py
branchstable
changeset 7727 70ea754d3e04
parent 7708 45be3a9debe6
child 7731 48e78934a4e2
equal deleted inserted replaced
7726:fdae265d36e7 7727:70ea754d3e04
   349                     raise
   349                     raise
   350         return error
   350         return error
   351 
   351 
   352     def parse(self, url):
   352     def parse(self, url):
   353         if url.startswith('http'):
   353         if url.startswith('http'):
   354             from cubicweb.sobjects.parsers import HOST_MAPPING
   354             from cubicweb.sobjects.parsers import URL_MAPPING
   355             for mappedurl in HOST_MAPPING:
   355             for mappedurl in URL_MAPPING:
   356                 if url.startswith(mappedurl):
   356                 if url.startswith(mappedurl):
   357                     url = url.replace(mappedurl, HOST_MAPPING[mappedurl], 1)
   357                     url = url.replace(mappedurl, URL_MAPPING[mappedurl], 1)
   358                     break
   358                     break
   359             self.source.info('GET %s', url)
   359             self.source.info('GET %s', url)
   360             stream = _OPENER.open(url)
   360             stream = _OPENER.open(url)
   361         elif url.startswith('file://'):
   361         elif url.startswith('file://'):
   362             stream = open(url[7:])
   362             stream = open(url[7:])