From 74d48bd43349997e903cc3c0b0d150da57543d2e Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Sat, 3 Feb 2018 13:46:17 +0100 Subject: [PATCH] Make pylint happy. --- tcllib/__init__.py | 18 +++++++++--------- tcllib/credentials.py | 2 +- tcllib/devlist.py | 2 +- tcllib/dumpmgr.py | 2 +- tcllib/servervote.py | 2 +- tcllib/tclcheck.py | 2 +- tcllib/tclchecksum.py | 2 +- tcllib/tclencheader.py | 2 +- tcllib/tclrequest.py | 2 +- tcllib/xmltools.py | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tcllib/__init__.py b/tcllib/__init__.py index b8a82d2..9731aeb 100644 --- a/tcllib/__init__.py +++ b/tcllib/__init__.py @@ -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"]) diff --git a/tcllib/credentials.py b/tcllib/credentials.py index 10ef96c..fa217e4 100644 --- a/tcllib/credentials.py +++ b/tcllib/credentials.py @@ -2,7 +2,7 @@ import base64 -class Credentials: +class CredentialsMixin: @staticmethod def get_creds(): creds = { diff --git a/tcllib/devlist.py b/tcllib/devlist.py index a6d92be..89cde77 100644 --- a/tcllib/devlist.py +++ b/tcllib/devlist.py @@ -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 diff --git a/tcllib/dumpmgr.py b/tcllib/dumpmgr.py index 04ad79f..a91b294 100644 --- a/tcllib/dumpmgr.py +++ b/tcllib/dumpmgr.py @@ -5,7 +5,7 @@ import glob import os from . import ansi -class DumpMgr: +class DumpMgrMixin: def __init__(self): self.last_dump_filename = None diff --git a/tcllib/servervote.py b/tcllib/servervote.py index 57acbdc..8c96dd1 100644 --- a/tcllib/servervote.py +++ b/tcllib/servervote.py @@ -2,7 +2,7 @@ import numpy -class ServerVote: +class ServerVoteMixin: def __init__(self): self.g2master = None self.master_servers = [ diff --git a/tcllib/tclcheck.py b/tcllib/tclcheck.py index f370f44..30c8b7a 100644 --- a/tcllib/tclcheck.py +++ b/tcllib/tclcheck.py @@ -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" diff --git a/tcllib/tclchecksum.py b/tcllib/tclchecksum.py index 13fba15..30d77e9 100644 --- a/tcllib/tclchecksum.py +++ b/tcllib/tclchecksum.py @@ -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() diff --git a/tcllib/tclencheader.py b/tcllib/tclencheader.py index 47e1a24..48bb168 100644 --- a/tcllib/tclencheader.py +++ b/tcllib/tclencheader.py @@ -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") diff --git a/tcllib/tclrequest.py b/tcllib/tclrequest.py index 6bdc4fb..adde5cb 100644 --- a/tcllib/tclrequest.py +++ b/tcllib/tclrequest.py @@ -31,7 +31,7 @@ from defusedxml import ElementTree } ''' -class TclRequest: +class TclRequestMixin: @staticmethod def get_salt(): millis = floor(time.time() * 1000) diff --git a/tcllib/xmltools.py b/tcllib/xmltools.py index 9cc8fc4..825edc6 100644 --- a/tcllib/xmltools.py +++ b/tcllib/xmltools.py @@ -2,7 +2,7 @@ import xml.dom.minidom -class XmlTools: +class XmlToolsMixin: @staticmethod def pretty_xml(xmlstr): mdx = xml.dom.minidom.parseString(xmlstr)