Skip to content

Commit

Permalink
fixed format exception
Browse files Browse the repository at this point in the history
  • Loading branch information
wuan committed Jul 1, 2016
1 parent 409b48b commit d521ae5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion blitzortung/data.py
Expand Up @@ -117,7 +117,10 @@ def __init__(self, number, user, name, country, x_coord, y_coord, last_data, sta
def __str__(self):
offline_since = self.timestamp
status_char = "*" if offline_since is None else "-"
status_text = "" if offline_since is None else " offline since " + offline_since.strftime("%Y-%m-%d %H:%M %Z")
try:
status_text = "" if offline_since is None else " offline since " + offline_since.strftime("%Y-%m-%d %H:%M %Z")
except ValueError:
status_text = 'n/a'
return u"%s%3d/%3d '%s' '%s' (%.4f, %.4f)%s" % (
status_char, self.number, self.user, self.name, self.country, self.x, self.y, status_text)

Expand Down

0 comments on commit d521ae5

Please sign in to comment.