1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-09-20 06:43:26 +01:00

Colourise new OTA versions. More colours in tcllib.

This commit is contained in:
Markus Birth 2017-10-18 22:42:05 +02:00
parent cbd4c18ce6
commit a25897e3fa
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
2 changed files with 9 additions and 1 deletions

View File

@ -38,7 +38,8 @@ with open("prds.txt", "r") as f:
fc.fv = lastver fc.fv = lastver
check_xml = fc.do_check(max_tries=20) check_xml = fc.do_check(max_tries=20)
curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml) curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml)
print("{}: {}{} {} ({})".format(prd, fv, tv, fhash, model)) versioninfo = tcllib.ANSI_CYAN_DARK + fv + tcllib.ANSI_RESET + "" + tcllib.ANSI_CYAN + tv + tcllib.ANSI_RESET
print("{}: {} {} ({})".format(prd, versioninfo, fhash, model))
except RequestException as e: except RequestException as e:
print("{} ({}): {}".format(prd, lastver, str(e))) print("{} ({}): {}".format(prd, lastver, str(e)))
continue continue

View File

@ -19,6 +19,13 @@ import requests
from defusedxml import ElementTree from defusedxml import ElementTree
ANSI_UP_DEL = u"\u001b[F\u001b[K" ANSI_UP_DEL = u"\u001b[F\u001b[K"
ANSI_BLACK = u"\u001b[0;30m"
ANSI_RED_DARK = u"\u001b[0;31m"
ANSI_GREEN_DARK = u"\001b[0;32m"
ANSI_YELLOW_DARK = u"\u001b[0;33m"
ANSI_CYAN_DARK = u"\u001b[0;36m"
ANSI_SILVER = u"\u001b[0;37m"
ANSI_GREY = u"\u001b[1;30m"
ANSI_RED = u"\u001b[1;31m" ANSI_RED = u"\u001b[1;31m"
ANSI_GREEN = u"\001b[1;32m" ANSI_GREEN = u"\001b[1;32m"
ANSI_YELLOW = u"\u001b[1;33m" ANSI_YELLOW = u"\u001b[1;33m"