257 |
257 |
258 def extid2entity(self, uri, etype, **sourceparams): |
258 def extid2entity(self, uri, etype, **sourceparams): |
259 """return an entity for the given uri. May return None if it should be |
259 """return an entity for the given uri. May return None if it should be |
260 skipped |
260 skipped |
261 """ |
261 """ |
|
262 # if cwsource is specified and repository has a source with the same |
|
263 # name, call extid2eid on that source so entity will be properly seen as |
|
264 # coming from this source |
|
265 source = self._cw.repo.sources_by_uri.get( |
|
266 sourceparams.pop('cwsource', None), self.source) |
262 sourceparams['parser'] = self |
267 sourceparams['parser'] = self |
263 eid = self.source.extid2eid(str(uri), etype, self._cw, |
268 eid = source.extid2eid(str(uri), etype, self._cw, |
264 sourceparams=sourceparams) |
269 sourceparams=sourceparams) |
265 if eid < 0: |
270 if eid < 0: |
266 # entity has been moved away from its original source |
271 # entity has been moved away from its original source |
267 # |
272 # |
268 # Don't give etype to entity_from_eid so we get UnknownEid if the |
273 # Don't give etype to entity_from_eid so we get UnknownEid if the |
269 # entity has been removed |
274 # entity has been removed |