From 57355d7eb51ba5a268c6c95c9292a525c8dbb5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Celderlabs=E2=80=9D?= Date: Tue, 12 Mar 2019 21:34:16 -0400 Subject: [PATCH] flake8's 120 character limit is an utter annoying abomination. --- disco/api/http.py | 6 ++++-- disco/bot/bot.py | 3 ++- disco/gateway/client.py | 3 ++- disco/voice/client.py | 12 ++++++++---- disco/voice/udp.py | 9 ++++++--- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/disco/api/http.py b/disco/api/http.py index 4094085..79e6184 100644 --- a/disco/api/http.py +++ b/disco/api/http.py @@ -52,7 +52,8 @@ class Routes(object): CHANNELS_MESSAGES_REACTIONS_GET = (HTTPMethod.GET, CHANNELS + '/messages/{message}/reactions/{emoji}') CHANNELS_MESSAGES_REACTIONS_CREATE = (HTTPMethod.PUT, CHANNELS + '/messages/{message}/reactions/{emoji}/@me') CHANNELS_MESSAGES_REACTIONS_DELETE_ME = (HTTPMethod.DELETE, CHANNELS + '/messages/{message}/reactions/{emoji}/@me') - CHANNELS_MESSAGES_REACTIONS_DELETE_USER = (HTTPMethod.DELETE, CHANNELS + '/messages/{message}/reactions/{emoji}/{user}') + CHANNELS_MESSAGES_REACTIONS_DELETE_USER = (HTTPMethod.DELETE, + CHANNELS + '/messages/{message}/reactions/{emoji}/{user}') CHANNELS_PERMISSIONS_MODIFY = (HTTPMethod.PUT, CHANNELS + '/permissions/{permission}') CHANNELS_PERMISSIONS_DELETE = (HTTPMethod.DELETE, CHANNELS + '/permissions/{permission}') CHANNELS_INVITES_LIST = (HTTPMethod.GET, CHANNELS + '/invites') @@ -286,7 +287,8 @@ class HTTPClient(LoggingClass): raise response.exception else: if r.status_code == 429: - self.log.warning('Request responded w/ 429, retrying (but this should not happen, check your clock sync') + self.log.warning( + 'Request responded w/ 429, retrying (but this should not happen, check your clock sync') # If we hit the max retries, throw an error retry += 1 diff --git a/disco/bot/bot.py b/disco/bot/bot.py index 7966dfc..da9445c 100644 --- a/disco/bot/bot.py +++ b/disco/bot/bot.py @@ -154,7 +154,8 @@ class Bot(LoggingClass): except ImportError: self.log.warning('Failed to enable HTTP server, Flask is not installed') else: - self.log.info('Starting HTTP server bound to {}:{}'.format(self.config.http_host, self.config.http_port)) + self.log.info('Starting HTTP server bound to {}:{}'.format(self.config.http_host, + self.config.http_port)) self.http = Flask('disco') self.http_server = WSGIServer((self.config.http_host, self.config.http_port), self.http) self.http_server_greenlet = gevent.spawn(self.http_server.serve_forever) diff --git a/disco/gateway/client.py b/disco/gateway/client.py index d2c9321..8786825 100644 --- a/disco/gateway/client.py +++ b/disco/gateway/client.py @@ -254,7 +254,8 @@ class GatewayClient(LoggingClass): self.session_id = None wait_time = self.reconnects * 5 - self.log.info('Will attempt to {} after {} seconds'.format('resume' if self.session_id else 'reconnect', wait_time)) + self.log.info('Will attempt to {} after {} seconds'.format('resume' if self.session_id else 'reconnect', + wait_time)) gevent.sleep(wait_time) # Reconnect diff --git a/disco/voice/client.py b/disco/voice/client.py index a93f625..9e5ce0e 100644 --- a/disco/voice/client.py +++ b/disco/voice/client.py @@ -154,7 +154,8 @@ class VoiceClient(LoggingClass): return self.log.info( - '[{}] Set endpoint from VOICE_SERVER_UPDATE (state = {} / endpoint = {})'.format(self, self.state, endpoint)) + '[{}] Set endpoint from VOICE_SERVER_UPDATE (state = {} / endpoint = {})'.format(self, self.state, + endpoint)) self.endpoint = endpoint @@ -246,7 +247,8 @@ class VoiceClient(LoggingClass): self.set_state(VoiceState.AUTHENTICATED) def on_voice_ready(self, data): - self.log.info('[{}] Received Voice READY payload, attempting to negotiate voice connection w/ remote'.format(self)) + self.log.info('[{}] Received Voice READY payload, attempting to negotiate voice connection w/ remote'.format( + self)) self.set_state(VoiceState.CONNECTING) self.ssrc = data['ssrc'] self.ip = data['ip'] @@ -281,7 +283,8 @@ class VoiceClient(LoggingClass): 'payload_type': RTPPayloadTypes.get(codec).value, }) - self.log.debug('[{}] IP discovery completed (ip = {}, port = {}), sending SELECT_PROTOCOL'.format(self, ip, port)) + self.log.debug('[{}] IP discovery completed (ip = {}, port = {}), sending SELECT_PROTOCOL'.format(self, ip, + port)) self.send(VoiceOPCode.SELECT_PROTOCOL, { 'protocol': 'udp', 'data': { @@ -396,7 +399,8 @@ class VoiceClient(LoggingClass): wait_time = 1 self.log.info( - '[{}] Will attempt to {} after {} seconds'.format(self, 'resume' if self._identified else 'reconnect', wait_time)) + '[{}] Will attempt to {} after {} seconds'.format(self, 'resume' if self._identified else 'reconnect', + wait_time)) gevent.sleep(wait_time) self._connect_and_run() diff --git a/disco/voice/udp.py b/disco/voice/udp.py index fd27f1d..35f86c9 100644 --- a/disco/voice/udp.py +++ b/disco/voice/udp.py @@ -103,7 +103,8 @@ class UDPVoiceClient(LoggingClass): ptype = RTPPayloadTypes.get(codec) self._rtp_audio_header[1] = ptype.value - self.log.debug('[{}] Set UDP\'s Audio Codec to {}, RTP payload type {}'.format(self.vc, ptype.name, ptype.value)) + self.log.debug('[{}] Set UDP\'s Audio Codec to {}, RTP payload type {}'.format(self.vc, ptype.name, + ptype.value)) def increment_timestamp(self, by): self.timestamp += by @@ -220,14 +221,16 @@ class UDPVoiceClient(LoggingClass): # Check if rtp version is 2 if rtp.version != 2: - self.log.debug('[{}] [VoiceData] Received an invalid RTP packet version, {}'.format(self.vc, rtp.version)) + self.log.debug('[{}] [VoiceData] Received an invalid RTP packet version, {}'.format(self.vc, + rtp.version)) continue payload_type = RTPPayloadTypes.get(rtp.payload_type) # Unsupported payload type received if not payload_type: - self.log.debug('[{}] [VoiceData] Received unsupported payload type, {}'.format(self.vc, rtp.payload_type)) + self.log.debug('[{}] [VoiceData] Received unsupported payload type, {}'.format(self.vc, + rtp.payload_type)) continue nonce = bytearray(24)