Ticket #339 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

second patch - not sure of intent

Reported by: sgillies Assigned to: sgillies
Priority: major Milestone: PleiadesGeocoder 1.0
Component: Geocoder Version: Beta
Keywords: Cc: slinkp

Description

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?

Attachments

pleiades-notsure.patch (2.4 kB) - added by sgillies on 11/14/07 11:04:47.

Change History

11/14/07 11:04:47 changed by sgillies

  • attachment pleiades-notsure.patch added.

11/14/07 14:58:10 changed by sgillies

  • status changed from new to assigned.
  • milestone set to PleiadesGeocoder 1.0.

This clarifies geoItems. The block at the end allows single objects to yield one geo item, and is the basis for georss or kml views of a single item.

11/14/07 14:59:20 changed by sgillies

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in r1228. Thanks for the patch.