fix pep8 failures

This commit is contained in:
Kenneth Giusti
2016-07-22 11:40:22 -04:00
parent 011d101dcf
commit 22e91f7eb0
5 changed files with 8 additions and 10 deletions

View File

@@ -373,7 +373,7 @@ def main(argv=None):
# Create the RPC caller
method = {'method': method_info[0],
'args': dict([(method_info[i], method_info[i+1])
'args': dict([(method_info[i], method_info[i + 1])
for i in range(1, len(method_info), 2)])}
my_caller = my_connection.create_caller(method,
"my-source-address",

View File

@@ -424,8 +424,6 @@ class Connection(Endpoint):
self._pn_sasl = None
self._pn_ssl = None
_REMOTE_REQ = (proton.Endpoint.LOCAL_UNINIT
| proton.Endpoint.REMOTE_ACTIVE)
_CLOSED = (proton.Endpoint.LOCAL_CLOSED | proton.Endpoint.REMOTE_CLOSED)
_ACTIVE = (proton.Endpoint.LOCAL_ACTIVE | proton.Endpoint.REMOTE_ACTIVE)

View File

@@ -188,15 +188,15 @@ class _Link(Endpoint):
def active(self):
state = self._pn_link.state
return (not self._failed and
state == (proton.Endpoint.LOCAL_ACTIVE
| proton.Endpoint.REMOTE_ACTIVE))
state == (proton.Endpoint.LOCAL_ACTIVE |
proton.Endpoint.REMOTE_ACTIVE))
@property
def closed(self):
state = self._pn_link.state
return (self._failed or
state == (proton.Endpoint.LOCAL_CLOSED
| proton.Endpoint.REMOTE_CLOSED))
state == (proton.Endpoint.LOCAL_CLOSED |
proton.Endpoint.REMOTE_CLOSED))
def reject(self, pn_condition):
self._rejected = True # prevent 'active' callback!

View File

@@ -201,8 +201,8 @@ class APITest(common.Test):
assert c1_events.remote_closed_ct == 0
c2.close()
common.process_connections(c1, c2)
assert (c1_events.remote_closed_ct == 1
and c2_events.remote_closed_ct == 0)
assert (c1_events.remote_closed_ct == 1 and
c2_events.remote_closed_ct == 0)
assert c1_events.closed_ct == 0 and c2_events.closed_ct == 0
assert not c1.active and not c2.active
c1.close()

View File

@@ -9,7 +9,7 @@ deps = -r{toxinidir}/test-requirements.txt
commands = {toxinidir}/tests/test-runner
[testenv:pep8]
commands = flake8 pyngus examples tests
commands = flake8 --ignore E402 pyngus examples tests
flake8 --ignore F401 setup.py
[flake8]