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

Make pylint happy.

This commit is contained in:
Markus Birth 2018-02-03 13:46:17 +01:00
parent 2f86f7698a
commit 74d48bd433
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
10 changed files with 18 additions and 18 deletions

View File

@ -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"])

View File

@ -2,7 +2,7 @@
import base64
class Credentials:
class CredentialsMixin:
@staticmethod
def get_creds():
creds = {

View File

@ -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

View File

@ -5,7 +5,7 @@ import glob
import os
from . import ansi
class DumpMgr:
class DumpMgrMixin:
def __init__(self):
self.last_dump_filename = None

View File

@ -2,7 +2,7 @@
import numpy
class ServerVote:
class ServerVoteMixin:
def __init__(self):
self.g2master = None
self.master_servers = [

View File

@ -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"

View File

@ -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()

View File

@ -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")

View File

@ -31,7 +31,7 @@ from defusedxml import ElementTree
}
'''
class TclRequest:
class TclRequestMixin:
@staticmethod
def get_salt():
millis = floor(time.time() * 1000)

View File

@ -2,7 +2,7 @@
import xml.dom.minidom
class XmlTools:
class XmlToolsMixin:
@staticmethod
def pretty_xml(xmlstr):
mdx = xml.dom.minidom.parseString(xmlstr)