Skip to content

Commit

Permalink
Merge pull request #32 from hivesolutions/pylint/fixes
Browse files Browse the repository at this point in the history
Pylint/fixes
  • Loading branch information
joamag committed Mar 11, 2019
2 parents 45d50bc + 7fe7a90 commit b9e8815
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/netius/base/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
# imports the base (old) version of the async implementation
# that should be compatible with all the available python
# interpreters, base collection of async library
from .async_old import * #@UnusedWildImport
from .async_old import * #@UnusedWildImport pylint: disable=W0614

# verifies if the current python interpreter version supports
# the new version of the async implementation and if that's the
# case runs the additional import of symbols, this should override
# most of the symbols that have just been created
if is_neo(): from .async_neo import * #@UnusedWildImport
if is_neo(): from .async_neo import * #@UnusedWildImport pylint: disable=W0614
2 changes: 1 addition & 1 deletion src/netius/base/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def ensure(
# creates the coroutine that is going to be used to
# encapsulate the callable, note that the result of the
# callable is set as the result of the future (as expected)
def coroutine(future, *args, **kwargs):
def coroutine(future, *args, **kwargs): #pylint ignore=E0102
yield
result = coroutine_c(*args, **kwargs)
future.set_result(result)
Expand Down
4 changes: 2 additions & 2 deletions src/netius/base/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ def _flush_send(self):
if not self._delayed: break
if not self._writing: break
data, address, callback = self._delayed.pop(0)
if address: self.send(data, address, callback = callback)
else: self.send(data, callback = callback)
if address: self.send(data, address, callback = callback) #pylint: disable=E1101
else: self.send(data, callback = callback) #pylint: disable=E1101

class DatagramProtocol(Protocol):

Expand Down
6 changes: 3 additions & 3 deletions src/netius/base/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
__license__ = "Apache License, Version 2.0"
""" The license for the module """

from .common import * #@UnusedWildImport
from .common import * #@UnusedWildImport pylint: disable=W0614

BUFFER_SIZE_S = None
""" The size of both the send and receive buffers for
Expand Down Expand Up @@ -229,7 +229,7 @@ def serve(
# checks the type of service that is meant to be created and
# creates a service socket according to the defined service
family = socket.AF_INET6 if ipv6 else socket.AF_INET
family = socket.AF_UNIX if is_unix else family
family = socket.AF_UNIX if is_unix else family #@UndefinedVariable pylint: disable=E1101
if type == TCP_TYPE: self.socket = self.socket_tcp(
ssl,
key_file = key_file,
Expand Down Expand Up @@ -257,7 +257,7 @@ def serve(

# in case the set user id value the user of the current process should
# be changed so that it represents the new (possibly unprivileged user)
if setuid: os.setuid(setuid)
if setuid: os.setuid(setuid) #pylint: disable=E1101

# in case the selected port is zero based, meaning that a randomly selected
# port has been assigned by the bind operation the new port must be retrieved
Expand Down
8 changes: 4 additions & 4 deletions src/netius/clients/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ def wrap_request(
buffer = tempfile.NamedTemporaryFile(mode = "w+b") if use_file else []
self.request = dict(code = None, data = None)

def on_close(protocol):
def on_close(protocol): #pylint: disable=E0102
if _on_close: _on_close(protocol)
protocol._request = None
if self.request["code"]: return
Expand All @@ -836,15 +836,15 @@ def on_close(protocol):
request = self.request
)

def on_data(protocol, parser, data):
def on_data(protocol, parser, data): #pylint: disable=E0102
if _on_data: _on_data(protocol, parser, data)
if use_file: buffer.write(data)
else: buffer.append(data)
received = self.request.get("received", 0)
self.request["received"] = received + len(data)
self.request["last"] = time.time()

def callback(protocol, parser, message):
def callback(protocol, parser, message): #pylint: disable=E0102
if _callback: _callback(protocol, parser, message)
if use_file: cls.set_request_file(parser, buffer, request = self.request)
else: cls.set_request(parser, buffer, request = self.request)
Expand Down Expand Up @@ -1426,7 +1426,7 @@ def on_message(protocol, parser, message):
self.available[protocol.key] = protocol
netius.compat_loop(loop).stop()

def on_close(protocol):
def on_close(protocol): #pylint: disable=E0102
# verifies if the protocol being closed is currently in
# the pool of available protocols, so that decisions on
# the stopping of the event loop may be made latter on
Expand Down

0 comments on commit b9e8815

Please sign in to comment.