mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Pylint cleanup.
Add more dynamic attribute info to IPATypeChecker in make-lint. Remove unnecessary pylint comments. Fix false positivies introduced by Pylint 0.26. https://fedorahosted.org/freeipa/ticket/3379
This commit is contained in:
committed by
Martin Kosek
parent
41d11f443b
commit
77bb4b5177
@@ -64,12 +64,6 @@ escaping and unescapin.
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# FIXME: The use of properties for the attributes timestamp, expires
|
||||
# and max_age produce a pylint error which is a false positive, this
|
||||
# is a known bug in pylint (http://www.logilab.org/ticket/89092,
|
||||
# http://www.logilab.org/ticket/89786) after the pylint bug is fixed
|
||||
# the disables for E0202 should be removed.
|
||||
|
||||
class Cookie(object):
|
||||
'''
|
||||
A Cookie object has the following attributes:
|
||||
@@ -366,7 +360,7 @@ class Cookie(object):
|
||||
self.timestamp = timestamp
|
||||
|
||||
@property
|
||||
def timestamp(self): #pylint: disable=E0202
|
||||
def timestamp(self):
|
||||
'''
|
||||
The UTC moment at which cookie was received for purposes of
|
||||
computing the expiration given a Max-Age offset. The
|
||||
@@ -389,7 +383,7 @@ class Cookie(object):
|
||||
return self._timestamp
|
||||
|
||||
@timestamp.setter
|
||||
def timestamp(self, value): #pylint: disable=E0202
|
||||
def timestamp(self, value):
|
||||
if value is None:
|
||||
self._timestamp = None
|
||||
elif isinstance(value, datetime.datetime):
|
||||
@@ -403,7 +397,7 @@ class Cookie(object):
|
||||
value.__class__.__name__)
|
||||
|
||||
@property
|
||||
def expires(self): #pylint: disable=E0202
|
||||
def expires(self):
|
||||
'''
|
||||
The expiration timestamp (in UTC) as a datetime object for the
|
||||
cookie, or None if not set.
|
||||
@@ -415,7 +409,7 @@ class Cookie(object):
|
||||
return self._expires
|
||||
|
||||
@expires.setter
|
||||
def expires(self, value): #pylint: disable=E0202
|
||||
def expires(self, value):
|
||||
if value is None:
|
||||
self._expires = None
|
||||
elif isinstance(value, datetime.datetime):
|
||||
@@ -429,7 +423,7 @@ class Cookie(object):
|
||||
value.__class__.__name__)
|
||||
|
||||
@property
|
||||
def max_age(self): #pylint: disable=E0202
|
||||
def max_age(self):
|
||||
'''
|
||||
The lifetime duration of the cookie. Computed as an offset
|
||||
from the cookie's timestamp.
|
||||
@@ -437,7 +431,7 @@ class Cookie(object):
|
||||
return self._max_age
|
||||
|
||||
@max_age.setter
|
||||
def max_age(self, value): #pylint: disable=E0202
|
||||
def max_age(self, value):
|
||||
if value is None:
|
||||
self._max_age = None
|
||||
else:
|
||||
|
||||
@@ -775,7 +775,7 @@ def bind_port_responder(port, socket_type=socket.SOCK_STREAM, socket_timeout=Non
|
||||
connection, client_address = s.accept()
|
||||
try:
|
||||
if responder_data:
|
||||
connection.sendall(responder_data) #pylint: disable=E1101
|
||||
connection.sendall(responder_data)
|
||||
finally:
|
||||
connection.close()
|
||||
elif socket_type == socket.SOCK_DGRAM:
|
||||
|
||||
@@ -200,14 +200,15 @@ class NSSConnection(httplib.HTTPConnection, NSSAddressFamilyFallback):
|
||||
def _create_socket(self):
|
||||
# TODO: remove the try block once python-nss is guaranteed to contain
|
||||
# these values
|
||||
try :
|
||||
ssl_enable_renegotiation = SSL_ENABLE_RENEGOTIATION #pylint: disable=E0602
|
||||
ssl_require_safe_negotiation = SSL_REQUIRE_SAFE_NEGOTIATION #pylint: disable=E0602
|
||||
ssl_renegotiate_requires_xtn = SSL_RENEGOTIATE_REQUIRES_XTN #pylint: disable=E0602
|
||||
except :
|
||||
ssl_enable_renegotiation = 20
|
||||
ssl_require_safe_negotiation = 21
|
||||
ssl_renegotiate_requires_xtn = 2
|
||||
try:
|
||||
#pylint: disable=E1101
|
||||
ssl_enable_renegotiation = ssl.SSL_ENABLE_RENEGOTIATION
|
||||
ssl_require_safe_negotiation = ssl.SSL_REQUIRE_SAFE_NEGOTIATION
|
||||
ssl_renegotiate_requires_xtn = ssl.SSL_RENEGOTIATE_REQUIRES_XTN
|
||||
except:
|
||||
ssl_enable_renegotiation = 20
|
||||
ssl_require_safe_negotiation = 21
|
||||
ssl_renegotiate_requires_xtn = 2
|
||||
|
||||
# Create the socket here so we can do things like let the caller
|
||||
# override the NSS callbacks
|
||||
|
||||
Reference in New Issue
Block a user