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