~stefanor/ibid/sphinxdoc-man

« back to all changes in this revision

Viewing changes to ibid/plugins/geography.py

  • Committer: Max Rabkin
  • Date: 2011-11-20 14:59:09 UTC
  • mto: This revision was merged to the branch mainline in revision 1042.
  • Revision ID: max.rabkin@gmail.com-20111120145909-1mhqxm7cs250qahh
handle non-existent places

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
    @match(r"coord(?:inate)?s (?:for|of|to) (.*)")
150
150
    def coordinates(self, event, place):
151
151
        place_data = self.get_place(place)
 
152
        if not place_data:
 
153
            event.addresponse("I've never heard of %s", place)
 
154
            return
 
155
 
152
156
        lat_deg = degrees(place_data['lat'])
153
157
        lng_deg = degrees(place_data['lng'])
154
158
        place_data.update({