Skip to content

Commit

Permalink
Add pylint exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusb committed May 9, 2022
1 parent a9f3a14 commit 77d6bf5
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions pypureomapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def __init__(self): # pylint:disable=super-init-not-called
OmapiError.__init__(self, "attribute not found") # pylint:disable=non-parent-init-called


class OutBuffer(object):
class OutBuffer(object): # pylint:disable=useless-object-inheritance
"""Helper class for constructing network packets."""
sizelimit = 65536

Expand Down Expand Up @@ -233,7 +233,7 @@ def consume(self, length):
return self


class OmapiStartupMessage(object):
class OmapiStartupMessage(object): # pylint:disable=useless-object-inheritance
"""Class describing the protocol negotiation messages.
>>> s = OmapiStartupMessage().as_string()
Expand Down Expand Up @@ -292,7 +292,7 @@ def dump_oneline(self):
return "protocol_version=%d header_size=%d" % (self.protocol_version, self.header_size)


class OmapiAuthenticatorBase(object):
class OmapiAuthenticatorBase(object): # pylint:disable=useless-object-inheritance
"""Base class for OMAPI authenticators.
@cvar authlen: is the length of a signature as returned by the sign method
@type authlen: int
Expand Down Expand Up @@ -374,7 +374,7 @@ def sign(self, message):
__all__.append("OmapiMessage")


class OmapiMessage(object): # pylint:disable=too-many-instance-attributes
class OmapiMessage(object): # pylint:disable=too-many-instance-attributes,useless-object-inheritance
"""
@type authid: int
@ivar authid: The id of the message authenticator.
Expand Down Expand Up @@ -585,7 +585,7 @@ def parse_chain(*args):
yield tuple(items)


class InBuffer(object):
class InBuffer(object): # pylint:disable=useless-object-inheritance
sizelimit = 65536

def __init__(self, initial=b""):
Expand Down Expand Up @@ -823,15 +823,15 @@ def unpack_mac(sixbytes):
return ":".join(["%2.2x".__mod__(x) for x in bytes_to_int_seq(sixbytes)])


class LazyStr(object): # pylint:disable=too-few-public-methods
class LazyStr(object): # pylint:disable=too-few-public-methods,useless-object-inheritance
def __init__(self, fnc):
self.function = fnc

def __str__(self):
return self.function()


class TCPClientTransport(object):
class TCPClientTransport(object): # pylint:disable=useless-object-inheritance
"""PEP 3156 dummy transport class to support OmapiProtocol class."""
def __init__(self, protocol, host, port, timeout=None):
self.protocol = protocol
Expand Down Expand Up @@ -880,7 +880,7 @@ def write(self, data):
raise


class OmapiProtocol(object):
class OmapiProtocol(object): # pylint:disable=useless-object-inheritance
"""PEP 3156 like protocol class for Omapi.
This interface is not yet to be relied upon.
Expand Down Expand Up @@ -951,7 +951,7 @@ def send_message(self, message, sign=True):
__all__.append("Omapi")


class Omapi(object): # pylint:disable=too-many-public-methods
class Omapi(object): # pylint:disable=too-many-public-methods,useless-object-inheritance
def __init__(self, hostname, port, username=None, key=None, timeout=None): # pylint:disable=too-many-arguments
"""
@type hostname: str
Expand Down Expand Up @@ -1088,7 +1088,7 @@ def lookup_ip_host(self, mac):
try:
return res["ip-address"]
except KeyError:
raise OmapiErrorAttributeNotFound()
raise OmapiErrorAttributeNotFound() # pylint:disable=raise-missing-from

def lookup_ip(self, mac):
"""Look for a lease object with given mac address and return the
Expand All @@ -1106,7 +1106,7 @@ def lookup_ip(self, mac):
try:
return res["ip-address"]
except KeyError:
raise OmapiErrorAttributeNotFound()
raise OmapiErrorAttributeNotFound() # pylint:disable=raise-missing-from

def lookup_mac(self, ip):
"""Look up a lease object with given ip address and return the
Expand All @@ -1124,7 +1124,7 @@ def lookup_mac(self, ip):
try:
return res["hardware-address"]
except KeyError:
raise OmapiErrorAttributeNotFound()
raise OmapiErrorAttributeNotFound() # pylint:disable=raise-missing-from

def lookup_host(self, name):
"""Look for a host object with given name and return the
Expand All @@ -1142,7 +1142,7 @@ def lookup_host(self, name):
try:
return dict(ip=res["ip-address"], mac=res["hardware-address"], hostname=res["name"].decode('utf-8'))
except KeyError:
raise OmapiErrorAttributeNotFound()
raise OmapiErrorAttributeNotFound() # pylint:disable=raise-missing-from

def lookup_host_by_ip(self, ip):
"""Look for a host object with given ip address and return the
Expand All @@ -1160,7 +1160,7 @@ def lookup_host_by_ip(self, ip):
try:
return dict(ip=res["ip-address"], mac=res["hardware-address"], hostname=res["name"].decode('utf-8'))
except KeyError:
raise OmapiErrorAttributeNotFound()
raise OmapiErrorAttributeNotFound() # pylint:disable=raise-missing-from

def lookup_host_host(self, mac):
"""Look for a host object with given mac address and return the
Expand All @@ -1178,7 +1178,7 @@ def lookup_host_host(self, mac):
try:
return dict(ip=res["ip-address"], mac=res["hardware-address"], name=res["name"].decode('utf-8'))
except KeyError:
raise OmapiErrorAttributeNotFound()
raise OmapiErrorAttributeNotFound() # pylint:disable=raise-missing-from

def lookup_hostname(self, ip):
"""Look up a lease object with given ip address and return the associated client hostname.
Expand Down

0 comments on commit 77d6bf5

Please sign in to comment.