1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-11-09 22:06:47 +00:00

make escape characters semi-work on windows

This commit is contained in:
thurask 2017-09-23 16:17:57 -04:00
parent 445502b544
commit 0e3ebafb2d
No known key found for this signature in database
GPG Key ID: A6CCCDEA29795048
4 changed files with 16 additions and 0 deletions

View File

@ -6,6 +6,7 @@
import tcllib
from requests.exceptions import RequestException, Timeout
tcllib.make_escapes_work()
ANSI_UP_DEL = u"\u001b[F\u001b[K"
fc = tcllib.FotaCheck()

View File

@ -6,6 +6,7 @@
import tcllib
from requests.exceptions import RequestException, Timeout
tcllib.make_escapes_work()
ANSI_UP_DEL = u"\u001b[F\u001b[K"
fc = tcllib.FotaCheck()

View File

@ -6,6 +6,7 @@
import tcllib
from requests.exceptions import RequestException, Timeout
tcllib.make_escapes_work()
ANSI_UP_DEL = u"\u001b[F\u001b[K"
fc = tcllib.FotaCheck()

View File

@ -5,6 +5,7 @@
import base64
import binascii
import hashlib
import platform
import random
import time
import xml.dom.minidom
@ -17,6 +18,18 @@ except (ImportError, AttributeError):
from xml.etree import ElementTree
import requests
def make_escapes_work():
system = platform.system()
if system == "Windows":
try:
import colorama
except ImportError:
pass
else:
colorama.init()
class FotaCheck:
VDKEY = b"eJwdjwEOwDAIAr8kKFr//7HhmqXp8AIIDrYAgg8byiUXrwRJRXja+d6iNxu0AhUooDCN9rd6rDLxmGIakUVWo3IGCTRWqCAt6X4jGEIUAxgN0eYWnp+LkpHQAg/PsO90ELsy0Npm/n2HbtPndFgGEV31R9OmT4O4nrddjc3Qt6nWscx7e+WRHq5UnOudtjw5skuV09pFhvmqnOEIs4ljPeel1wfLYUF4\n"
CKTP_CHECKAUTO = 1