Skip to content
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.

Commit

Permalink
bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
emka committed Oct 15, 2009
1 parent db47727 commit 4c872f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions api/0.1/addPOIexec
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def main():

# Check that parameters have a valid format:
coord_exp = re.compile(r"^-?\d{1,3}(\.\d+)?$")
if not coord_exp.match(values["lat"]) or not (-180 <= float(values["lat"]) and float(values["lat"]) <= 180):
if not coord_exp.match(values["lat"]) or not (-90 <= float(values["lat"]) and float(values["lat"]) <= 90):
if output_format_js:
print "osbResponse(\"invalid or missing lat\");"
else:
Expand Down Expand Up @@ -84,9 +84,10 @@ def main():
pass
else:
dom = minidom.parseString(response.read())
name = dom.getElementsByTagName('name')[0].firstChild.data
country = dom.getElementsByTagName('countryCode')[0].firstChild.data
values["nearbyplace"] = "%s [%s]" % (name, country)
if dom.getElementsByTagName('name'):
name = dom.getElementsByTagName('name')[0].firstChild.data
country = dom.getElementsByTagName('countryCode')[0].firstChild.data
values["nearbyplace"] = "%s [%s]" % (name, country)


conn = MySQLdb.connect(db_config.host, user=db_config.user, passwd=db_config.password, db=db_config.dbname)
Expand Down

0 comments on commit 4c872f1

Please sign in to comment.