Skip to content

Commit

Permalink
Found a bug and fixed it ontop of my code.
Browse files Browse the repository at this point in the history
Some ips actually don't get locations so I added some code to where you guys set the location to check if the location returns nothing ( location2 == ", " ) to make the location label to say "cannot pinpoint location" instead of the naked , under the weather.
  • Loading branch information
SDK authored Sep 7, 2016
1 parent 1074a41 commit 2dcb56f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions smartmirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,12 @@ def get_weather(self):
self.temperature = temperature2
self.temperatureLbl.config(text=temperature2)
if self.location != location2:
self.location = location2
self.locationLbl.config(text=location2)
if location2 == ", ":
self.location = "Cannot Pinpoint Location"
self.locationLbl.config(text="Cannot Pinpoint Location")
else:
self.location = location2
self.locationLbl.config(text=location2)
except Exception as e:
traceback.print_exc()
print "Error: %s. Cannot get weather." % e
Expand Down

0 comments on commit 2dcb56f

Please sign in to comment.