Skip to content

Commit

Permalink
Merge pull request #1214 from carlostse/hotfix/pylint_check
Browse files Browse the repository at this point in the history
pylint_check - follow PEP8 and Pylint
  • Loading branch information
lukebakken committed Jul 9, 2019
2 parents f7c1067 + 6a15927 commit faba7b0
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 87 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import sys
sys.path.insert(0, '../')
#needs_sphinx = '1.0'
# needs_sphinx = '1.0'

extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode',
'sphinx.ext.intersphinx']
Expand Down
1 change: 0 additions & 1 deletion pika/adapters/blocking_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import functools
import logging
import threading
import time

import pika.compat as compat
import pika.exceptions as exceptions
Expand Down
8 changes: 4 additions & 4 deletions pika/adapters/select_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,10 @@ def start(self):
"""
if self._running:
raise RuntimeError('IOLoop is not reentrant and is already running')
else:
LOGGER.debug('Entering IOLoop')
self._running = True
self.activate_poller()

LOGGER.debug('Entering IOLoop')
self._running = True
self.activate_poller()

try:
# Run event loop
Expand Down
6 changes: 3 additions & 3 deletions pika/adapters/utils/connection_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ def abort(self):
"""
if self._state == self._STATE_INIT:
raise AMQPConnectorWrongState('Cannot abort before starting.')
elif self._state == self._STATE_DONE:
raise AMQPConnectorWrongState(
'Cannot abort after completion was reported')

if self._state == self._STATE_DONE:
raise AMQPConnectorWrongState('Cannot abort after completion was reported')

self._state = self._STATE_ABORTING
self._deactivate()
Expand Down
13 changes: 7 additions & 6 deletions pika/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,13 +1380,14 @@ def _raise_if_not_open(self):
return

if self._state == self.OPENING:
raise exceptions.ChannelWrongStateError(
'Channel is opening, but is not usable yet.')
elif self._state == self.CLOSING:
raise exceptions.ChannelWrongStateError('Channel is opening, but is not usable yet.')

if self._state == self.CLOSING:
raise exceptions.ChannelWrongStateError('Channel is closing.')
else: # Assumed self.CLOSED
assert self._state == self.CLOSED
raise exceptions.ChannelWrongStateError('Channel is closed.')

# Assumed self.CLOSED
assert self._state == self.CLOSED
raise exceptions.ChannelWrongStateError('Channel is closed.')

def _send_method(self, method, content=None):
"""Shortcut wrapper to send a method through our connection, passing in
Expand Down
4 changes: 2 additions & 2 deletions pika/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def __ne__(self, other):
return not result
return NotImplemented

def response_for(self, start): # pylint: disable=R0201
def response_for(self, start): # pylint: disable=R0201
"""Validate that this type of authentication is supported
:param spec.Connection.Start start: Connection.Start method
Expand All @@ -120,7 +120,7 @@ def response_for(self, start): # pylint: disable=R0201
return None, None
return ExternalCredentials.TYPE, b''

def erase_credentials(self): # pylint: disable=R0201
def erase_credentials(self): # pylint: disable=R0201
"""Called by Connection when it no longer needs the credentials"""
LOGGER.debug('Not supported by this Credentials type')

Expand Down
8 changes: 4 additions & 4 deletions tests/acceptance/async_adapter_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import functools
import socket
import threading
import time
import uuid

import pika
Expand Down Expand Up @@ -331,11 +330,12 @@ def __init__(self, parameters, *args, **kwargs):
MyConnectionClass.got_second_config = True
logger.info('Got second config.')
raise Exception('Reject second config.')
elif not MyConnectionClass.got_second_config:

if not MyConnectionClass.got_second_config:
logger.info('Still on first attempt with first config.')
raise Exception('Still on first attempt with first config.')
else:
logger.info('Start of retry cycle detected.')

logger.info('Start of retry cycle detected.')

super(MyConnectionClass, self).__init__(parameters,
*args,
Expand Down
1 change: 0 additions & 1 deletion tests/acceptance/async_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import functools
import os
import select
import ssl
import sys
import logging
import unittest
Expand Down

0 comments on commit faba7b0

Please sign in to comment.