fixed the wind calculation

This commit is contained in:
phm3
2015-11-30 20:33:03 +00:00
parent ee2b49b0a3
commit 461734a2ff

8
w.py
View File

@@ -61,7 +61,7 @@ response_update.raw.decode_content = True
events_update = ElementTree.iterparse(response_update.raw) events_update = ElementTree.iterparse(response_update.raw)
print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
print "\n>>>> Upcoming: \n" print "\n>>>> Upcoming: \n"
for elem, even in events_update: for elem, even in events_update:
@@ -74,7 +74,7 @@ for elem, even in events_update:
condi = even.text condi = even.text
if even.tag == 'F': if even.tag == 'F':
wind = even.text windu = even.text
if even.tag == 'ftime': if even.tag == 'ftime':
@@ -83,7 +83,7 @@ for elem, even in events_update:
if time >= justnow and time < mytime: if time >= justnow and time < mytime:
print "Time:", time, "UTC" print "Time:", time, "UTC"
print "Temperature: ", temp, "°C" print "Temperature: ", temp, "°C"
print "Wind: ", wind, "m/s", " » " ,int(wind) * 3.6, "km/h" print "Wind: ", windu, "m/s", " » " ,int(windu) * 3.6, "km/h"
print "Conditions:", condi, "\n" print "Conditions:", condi, "\n"
#break # the fall #break # the fall
@@ -94,7 +94,7 @@ print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
if os.name is "posix" and platform.system() == "Linux": if os.name is "posix" and platform.system() == "Linux":
from gi.repository import Notify from gi.repository import Notify
notification_text = (name + "\n" + temperature + " C\n" + str(int(wind) *3.6) + " km/h\n Conditions: " + str(conditions)) notification_text = (name + "\n" + temperature + " C\n" + str(int(wind) * 3.6) + " km/h\n Conditions: " + str(conditions))
Notify.init("Weather") Notify.init("Weather")
Hello = Notify.Notification.new("Vedur.is", notification_text) Hello = Notify.Notification.new("Vedur.is", notification_text)