small print weather

workspace
Brendan Howell 4 years ago
parent 90eadd57df
commit 85a08190f3

@ -143,16 +143,21 @@ class Publications(Bureau):
day_count = 0
current = "Today"
for period in forecast:
#TODO: make some nicer ascii art or b/w pngs for weather
# maybe steal these from the wego project?
prn.text(period["day"])
if period["day"] != current:
prn.text(period["day"])
day_count += 1
prn.text(" - " + period["period"] + "\r\n")
prn.close()
self.print_small_image(period["png"])
prn = self._get_small_printer()
prn.text(period["mintemp"] + " - " + period["maxtemp"] + "°")
if day_count > 3:
prn.text(period["mintemp"] + " - " + period["maxtemp"] + "C\r\n")
if day_count > 4:
break
prn.text("\r\n")
prn.cut()
prn.close()
@add_command("r", "Print a web page for reading")
def print_url(self, data):

Loading…
Cancel
Save