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