Attached is a patch that reorganizes geoCollectionSimple.geoItems()
a bit, because it had the same broken error handling repeated three
times. Broken because:
- you can't tell whether it's the adapter lookup or the assertion that fails
- if the adapter fails, you just "yield item" - but it's undefined.
So I factored that out into _adapt(self, ob) and fixed that to what I
think it should do. Feel free to modify, rename, ignore, etc.
What I was unsure of is, what's supposed to happen in the else clause
- when self.context doesn't implement any of the tested interfaces.
It looks like you're assuming it's not a folder, so we yield an
iterable of size 1? That's what my modified version tries to do. But
it's a bit confusing to see that functionality here, because:
- the class name and the docstring make clear it's only intended for folderish things
- this adapter isn't registered for any non-folderish interfaces anyway, so you can never hit this case at all.
I don't see anywhere else that adapts non-folderish content to georss
or kml, so i guess geoCollectionSimple is supposed to be it?