mirror of
https://github.com/mbirth/tcl_ota_check.git
synced 2024-11-09 22:06:47 +00:00
Moved Colorama boilerplate to ansi.py.
This commit is contained in:
parent
34ba8a0db0
commit
9920c13582
@ -9,8 +9,6 @@ import tcllib.argparser
|
||||
from tcllib import ansi
|
||||
from requests.exceptions import RequestException, Timeout
|
||||
|
||||
tcllib.make_escapes_work()
|
||||
|
||||
fc = tcllib.FotaCheck()
|
||||
fc.serid = "3531510"
|
||||
fc.fv = "AAA000"
|
||||
|
@ -11,8 +11,6 @@ import tcllib.argparser
|
||||
from tcllib import ansi
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
tcllib.make_escapes_work()
|
||||
|
||||
fc = tcllib.FotaCheck()
|
||||
fc.serid = "3531510"
|
||||
#fc.osvs = "7.1.1"
|
||||
|
@ -10,8 +10,6 @@ import tcllib.argparser
|
||||
from tcllib import ansi
|
||||
from requests.exceptions import RequestException, Timeout
|
||||
|
||||
tcllib.make_escapes_work()
|
||||
|
||||
fc = tcllib.FotaCheck()
|
||||
fc.serid = "3531510"
|
||||
fc.fv = "AAA000"
|
||||
|
@ -13,8 +13,6 @@ from requests.exceptions import RequestException, Timeout
|
||||
# Variants to scan for
|
||||
SCAN_VARIANTS = ["001", "003", "009", "010", "700"]
|
||||
|
||||
tcllib.make_escapes_work()
|
||||
|
||||
fc = tcllib.FotaCheck()
|
||||
fc.serid = "3531510"
|
||||
fc.fv = "AAA000"
|
||||
|
@ -9,8 +9,6 @@ import tcllib.argparser
|
||||
from tcllib import ansi
|
||||
from requests.exceptions import RequestException, Timeout
|
||||
|
||||
tcllib.make_escapes_work()
|
||||
|
||||
fc = tcllib.FotaCheck()
|
||||
fc.serid = "3531510"
|
||||
fc.mode = fc.MODE.OTA
|
||||
|
@ -9,8 +9,6 @@ import sys
|
||||
import tcllib
|
||||
from requests.exceptions import RequestException
|
||||
|
||||
tcllib.make_escapes_work()
|
||||
|
||||
# 1. Fetch list of missing OTAs (e.g. from ancient versions to current)
|
||||
# 2. Query updates from FOTA servers (and store XML)
|
||||
# (3. Upload will be done manually with upload_logs.py)
|
||||
|
@ -3,7 +3,6 @@
|
||||
# pylint: disable=C0111,C0326
|
||||
|
||||
import enum
|
||||
import platform
|
||||
import requests
|
||||
from . import credentials
|
||||
from . import devlist
|
||||
@ -15,17 +14,6 @@ from . import tclchecksum
|
||||
from . import tclencheader
|
||||
from . import xmltools
|
||||
|
||||
def make_escapes_work():
|
||||
system = platform.system()
|
||||
if system == "Windows":
|
||||
try:
|
||||
import colorama
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
colorama.init()
|
||||
|
||||
|
||||
def default_enum(enumname, vardict):
|
||||
return enum.IntEnum(enumname, vardict, module=__name__, qualname="tcllib.FotaCheck.{}".format(enumname))
|
||||
|
||||
|
@ -1,5 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import platform
|
||||
|
||||
# Needed to make ANSI escape sequences work in Windows
|
||||
system = platform.system()
|
||||
if system == "Windows":
|
||||
try:
|
||||
import colorama
|
||||
colorama.init()
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
UP_DEL = u"\u001b[F\u001b[K"
|
||||
BLACK = u"\u001b[0;30m"
|
||||
RED_DARK = u"\u001b[0;31m"
|
||||
|
Loading…
Reference in New Issue
Block a user