diff --git a/tgetwx.py b/tgetwx.py index d4e6961..2a9f76b 100755 --- a/tgetwx.py +++ b/tgetwx.py @@ -3,11 +3,11 @@ # Copyright (c) 2014 TundraWare Inc., Des Plaines, IL 60018 USA # All Rights Reserved. For Terms Of Use See: tgetwx-license.txt # For Program Updates See: http://www.tundraware.com/Software/tgetwx -# $Id: tgetwx.py,v 1.103 2014/03/04 00:58:38 tundra Exp $ +# $Id: tgetwx.py,v 1.104 2014/03/04 01:12:48 tundra Exp $ # Embed the source control ID string for use by program -CVSID='$Id: tgetwx.py,v 1.103 2014/03/04 00:58:38 tundra Exp $' +CVSID='$Id: tgetwx.py,v 1.104 2014/03/04 01:12:48 tundra Exp $' ##### # Program Information @@ -49,6 +49,7 @@ import json import os import sys +import time import urllib2 @@ -212,10 +213,11 @@ # Lookup was successful, populate data else: - # Order is Country, Date, Temp, Humidity, Pressure, Wind Speed, Wind Direction, Cloud Cover, Description + # Order is City Name, Country, Date, Temp, Humidity, Pressure, Wind Speed, Wind Direction, Cloud Cover, Description + results.append(data["name"]) results.append(data["sys"]["country"]) - results.append(data["dt"]) + results.append(time.strftime("%D %H:%M", time.localtime(int(data["dt"])))) results.append("%.0f" % (((data["main"]["temp"] - KELVIN) * 9/5) + 32) + "F" ) results.append("%.0f" % (data["main"]["humidity"])+ "%") results.append("%.2f" % (data["main"]["pressure"] * 0.0295299830714) + "in") @@ -224,8 +226,14 @@ results.append("%.0f" % (data["clouds"]["all"]) + "%") results.append(data["weather"][0]["description"]) + - print results + if EmitHTML: + print "This is where HTML will come out!" + + else: + print results +