mirror of
https://github.com/mbirth/tcl_ota_check.git
synced 2024-11-10 06:16:46 +00:00
Make pylint happy.
This commit is contained in:
parent
2f86f7698a
commit
74d48bd433
@ -18,15 +18,15 @@ def default_enum(enumname, vardict):
|
|||||||
return enum.IntEnum(enumname, vardict, module=__name__, qualname="tcllib.FotaCheck.{}".format(enumname))
|
return enum.IntEnum(enumname, vardict, module=__name__, qualname="tcllib.FotaCheck.{}".format(enumname))
|
||||||
|
|
||||||
class FotaCheck(
|
class FotaCheck(
|
||||||
tclcheck.TclCheck,
|
tclcheck.TclCheckMixin,
|
||||||
tclrequest.TclRequest,
|
tclrequest.TclRequestMixin,
|
||||||
tclchecksum.TclChecksum,
|
tclchecksum.TclChecksumMixin,
|
||||||
tclencheader.TclEncHeader,
|
tclencheader.TclEncHeaderMixin,
|
||||||
servervote.ServerVote,
|
servervote.ServerVoteMixin,
|
||||||
credentials.Credentials,
|
credentials.CredentialsMixin,
|
||||||
devlist.DevList,
|
devlist.DevListMixin,
|
||||||
dumpmgr.DumpMgr,
|
dumpmgr.DumpMgrMixin,
|
||||||
xmltools.XmlTools
|
xmltools.XmlToolsMixin
|
||||||
):
|
):
|
||||||
VDKEY = b"eJwdjwEOwDAIAr8kKFr//7HhmqXp8AIIDrYAgg8byiUXrwRJRXja+d6iNxu0AhUooDCN9rd6rDLxmGIakUVWo3IGCTRWqCAt6X4jGEIUAxgN0eYWnp+LkpHQAg/PsO90ELsy0Npm/n2HbtPndFgGEV31R9OmT4O4nrddjc3Qt6nWscx7e+WRHq5UnOudtjw5skuV09pFhvmqnOEIs4ljPeel1wfLYUF4\n"
|
VDKEY = b"eJwdjwEOwDAIAr8kKFr//7HhmqXp8AIIDrYAgg8byiUXrwRJRXja+d6iNxu0AhUooDCN9rd6rDLxmGIakUVWo3IGCTRWqCAt6X4jGEIUAxgN0eYWnp+LkpHQAg/PsO90ELsy0Npm/n2HbtPndFgGEV31R9OmT4O4nrddjc3Qt6nWscx7e+WRHq5UnOudtjw5skuV09pFhvmqnOEIs4ljPeel1wfLYUF4\n"
|
||||||
CKTP = default_enum("CKTP", ["AUTO", "MANUAL"])
|
CKTP = default_enum("CKTP", ["AUTO", "MANUAL"])
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
class Credentials:
|
class CredentialsMixin:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_creds():
|
def get_creds():
|
||||||
creds = {
|
creds = {
|
||||||
|
@ -10,7 +10,7 @@ DEVICELIST_URL = "https://tclota.birth-online.de/json_lastupdates.php"
|
|||||||
DEVICELIST_FILE = "prds.json"
|
DEVICELIST_FILE = "prds.json"
|
||||||
DEVICELIST_CACHE_SECONDS = 86400
|
DEVICELIST_CACHE_SECONDS = 86400
|
||||||
|
|
||||||
class DevList:
|
class DevListMixin:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_devicelist(force=False, output_diff=True):
|
def get_devicelist(force=False, output_diff=True):
|
||||||
need_download = True
|
need_download = True
|
||||||
|
@ -5,7 +5,7 @@ import glob
|
|||||||
import os
|
import os
|
||||||
from . import ansi
|
from . import ansi
|
||||||
|
|
||||||
class DumpMgr:
|
class DumpMgrMixin:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.last_dump_filename = None
|
self.last_dump_filename = None
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
|
|
||||||
class ServerVote:
|
class ServerVoteMixin:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.g2master = None
|
self.g2master = None
|
||||||
self.master_servers = [
|
self.master_servers = [
|
||||||
|
@ -5,7 +5,7 @@ from collections import OrderedDict
|
|||||||
import requests
|
import requests
|
||||||
from defusedxml import ElementTree
|
from defusedxml import ElementTree
|
||||||
|
|
||||||
class TclCheck:
|
class TclCheckMixin:
|
||||||
def do_check(self, https=True, timeout=10, max_tries=5):
|
def do_check(self, https=True, timeout=10, max_tries=5):
|
||||||
protocol = "https://" if https else "http://"
|
protocol = "https://" if https else "http://"
|
||||||
url = protocol + self.g2master + "/check.php"
|
url = protocol + self.g2master + "/check.php"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import json
|
import json
|
||||||
from defusedxml import ElementTree
|
from defusedxml import ElementTree
|
||||||
|
|
||||||
class TclChecksum:
|
class TclChecksumMixin:
|
||||||
def do_checksum(self, encslave, address, uri):
|
def do_checksum(self, encslave, address, uri):
|
||||||
url = "http://" + encslave + "/checksum.php"
|
url = "http://" + encslave + "/checksum.php"
|
||||||
params = self.get_creds2()
|
params = self.get_creds2()
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
class TclEncHeader:
|
class TclEncHeaderMixin:
|
||||||
def do_encrypt_header(self, encslave, address):
|
def do_encrypt_header(self, encslave, address):
|
||||||
params = self.get_creds2()
|
params = self.get_creds2()
|
||||||
params[b"address"] = bytes(address, "utf-8")
|
params[b"address"] = bytes(address, "utf-8")
|
||||||
|
@ -31,7 +31,7 @@ from defusedxml import ElementTree
|
|||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
class TclRequest:
|
class TclRequestMixin:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_salt():
|
def get_salt():
|
||||||
millis = floor(time.time() * 1000)
|
millis = floor(time.time() * 1000)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
|
|
||||||
class XmlTools:
|
class XmlToolsMixin:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def pretty_xml(xmlstr):
|
def pretty_xml(xmlstr):
|
||||||
mdx = xml.dom.minidom.parseString(xmlstr)
|
mdx = xml.dom.minidom.parseString(xmlstr)
|
||||||
|
Loading…
Reference in New Issue
Block a user