Exemplo n.º 1
0
	def _lookup(self):
		q = self.city if self.city is not None else self.county
		if q is None or len(q)==0:
			return
		if self.state is not None:
			q += ", " + self.state
		other = GeoLoc(lookup(q))
		if other.city is not None:
			self._copyfrom(other)
Exemplo n.º 2
0
def query(s):
	'''
	Usage

	>>> g = query('Hindelang')
	>>> g.city
	'Bad Hindelang'
	>>> g.zipcode
	'87541'
	>>> g.state
	'Bayern'
	'''

	g = GeoLoc(lookup(s))
	return g