From 524efe3c2ad92e2f2ff3f9b15576e4cad7d68eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 7 Jan 2018 14:48:07 +0100 Subject: [PATCH] Ignore some flake8 errors --- qweechat/buffer.py | 4 ++-- qweechat/qweechat.py | 2 +- qweechat/weechat/color.py | 6 +++--- qweechat/weechat/testproto.py | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/qweechat/buffer.py b/qweechat/buffer.py index facda99..90f4285 100644 --- a/qweechat/buffer.py +++ b/qweechat/buffer.py @@ -168,14 +168,14 @@ class Buffer(QtCore.QObject): try: self.widget.set_title( color.remove(self.data['title'].decode('utf-8'))) - except: + except: # noqa: E722 self.widget.set_title(None) def update_prompt(self): """Update prompt.""" try: self.widget.set_prompt(self.data['local_variables']['nick']) - except: + except: # noqa: E722 self.widget.set_prompt(None) def input_text_sent(self, text): diff --git a/qweechat/qweechat.py b/qweechat/qweechat.py index 6e1cce2..106a76d 100644 --- a/qweechat/qweechat.py +++ b/qweechat/qweechat.py @@ -329,7 +329,7 @@ class MainWindow(QtGui.QMainWindow): forcecolor='#008800') self.debug_display(0, '', 'Message: %s' % message) self.parse_message(message) - except: + except: # noqa: E722 print('Error while decoding message from WeeChat:\n%s' % traceback.format_exc()) self.network.disconnect_weechat() diff --git a/qweechat/weechat/color.py b/qweechat/weechat/color.py index 38f3364..685de19 100644 --- a/qweechat/weechat/color.py +++ b/qweechat/weechat/color.py @@ -91,7 +91,7 @@ class Color(): try: index = int(color) return '\x01(Fr%s)' % self.color_options[index] - except: + except: # noqa: E722 print('Error decoding WeeChat color "%s"' % color) return '' @@ -99,7 +99,7 @@ class Color(): try: index = int(color) return '\x01(%s%s#%s)' % (fg_bg, attrs, self._rgb_color(index)) - except: + except: # noqa: E722 print('Error decoding terminal color "%s"' % color) return '' @@ -122,7 +122,7 @@ class Color(): index = int(color) return self._convert_terminal_color(fg_bg, attrs, WEECHAT_BASIC_COLORS[index][1]) - except: + except: # noqa: E722 print('Error decoding color "%s"' % color) return '' diff --git a/qweechat/weechat/testproto.py b/qweechat/weechat/testproto.py index e013368..5bfdac6 100644 --- a/qweechat/weechat/testproto.py +++ b/qweechat/weechat/testproto.py @@ -61,7 +61,7 @@ class TestProto(object): try: self.sock = socket.socket(inet, socket.SOCK_STREAM) self.sock.connect((self.args.hostname, self.args.port)) - except: + except: # noqa: E722 if self.sock: self.sock.close() print('Failed to connect to', self.address) @@ -80,7 +80,7 @@ class TestProto(object): self.has_quit = True self.sock.sendall(msg + '\n') print('\x1b[33m<-- ' + msg + '\x1b[0m') - except: + except: # noqa: E722 traceback.print_exc() print('Failed to send message') return False @@ -105,7 +105,7 @@ class TestProto(object): protocol.hex_and_ascii(msgd.uncompressed, 20))) # display decoded message print('\x1b[32m--> {0}\x1b[0m'.format(msgd)) - except: + except: # noqa: E722 traceback.print_exc() print('Error while decoding message from WeeChat') return False @@ -181,7 +181,7 @@ class TestProto(object): recvbuf = '' sys.stdout.write(prompt + message) sys.stdout.flush() - except: + except: # noqa: E722 traceback.print_exc() self.send('quit') return 0