fixed the wind calculation
This commit is contained in:
8
w.py
8
w.py
@@ -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)
|
||||||
|
Reference in New Issue
Block a user