1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-09-19 22:33:25 +01:00

Moved ANSI_UP_DEL to tcllib.

This commit is contained in:
Markus Birth 2017-09-27 00:39:19 +02:00
parent c7f3e7bcaa
commit 095ba8cebb
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
4 changed files with 7 additions and 9 deletions

View File

@ -7,7 +7,6 @@ import tcllib
from requests.exceptions import RequestException, Timeout
tcllib.make_escapes_work()
ANSI_UP_DEL = u"\u001b[F\u001b[K"
fc = tcllib.FotaCheck()
fc.serid = "3531510"
@ -38,7 +37,7 @@ while len(prds) > 0:
prds.pop(0)
except Timeout as e:
print("{} failed. (Connection timed out.)".format(prd))
print(ANSI_UP_DEL, end="")
print(tcllib.ANSI_UP_DEL, end="")
continue
except (SystemExit, RequestException) as e:
print("{} failed. ({})".format(prd, str(e)))
@ -46,5 +45,5 @@ while len(prds) > 0:
# No update available or invalid request - remove from queue
prds.pop(0)
else:
print(ANSI_UP_DEL, end="")
print(tcllib.ANSI_UP_DEL, end="")
continue

View File

@ -7,7 +7,6 @@ import tcllib
from requests.exceptions import RequestException, Timeout
tcllib.make_escapes_work()
ANSI_UP_DEL = u"\u001b[F\u001b[K"
fc = tcllib.FotaCheck()
fc.serid = "3531510"
@ -38,7 +37,7 @@ while len(prds) > 0:
prds.pop(0)
except Timeout as e:
print("{} failed. (Connection timed out.)".format(prd))
print(ANSI_UP_DEL, end="")
print(tcllib.ANSI_UP_DEL, end="")
continue
except (SystemExit, RequestException) as e:
print("{} failed. ({})".format(prd, str(e)))
@ -46,5 +45,5 @@ while len(prds) > 0:
# No update available or invalid request - remove from queue
prds.pop(0)
else:
print(ANSI_UP_DEL, end="")
print(tcllib.ANSI_UP_DEL, end="")
continue

View File

@ -7,7 +7,6 @@ import tcllib
from requests.exceptions import RequestException, Timeout
tcllib.make_escapes_work()
ANSI_UP_DEL = u"\u001b[F\u001b[K"
fc = tcllib.FotaCheck()
fc.serid = "3531510"
@ -36,7 +35,7 @@ while len(prds) > 0:
prds.pop(0)
except Timeout as e:
print("{} failed. (Connection timed out.)".format(prd))
print(ANSI_UP_DEL, end="")
print(tcllib.ANSI_UP_DEL, end="")
continue
except (SystemExit, RequestException) as e:
print("{} ({}) failed. ({})".format(prd, lastver, str(e)))
@ -44,5 +43,5 @@ while len(prds) > 0:
# No update available or invalid request - remove from queue
prds.pop(0)
else:
print(ANSI_UP_DEL, end="")
print(tcllib.ANSI_UP_DEL, end="")
continue

View File

@ -18,6 +18,7 @@ except (ImportError, AttributeError):
from xml.etree import ElementTree
import requests
ANSI_UP_DEL = u"\u001b[F\u001b[K"
def make_escapes_work():
system = platform.system()