Ignore some flake8 errors

This commit is contained in:
Sébastien Helleu 2018-01-07 14:48:07 +01:00
parent 680505a912
commit 524efe3c2a
4 changed files with 10 additions and 10 deletions

View File

@ -168,14 +168,14 @@ class Buffer(QtCore.QObject):
try: try:
self.widget.set_title( self.widget.set_title(
color.remove(self.data['title'].decode('utf-8'))) color.remove(self.data['title'].decode('utf-8')))
except: except: # noqa: E722
self.widget.set_title(None) self.widget.set_title(None)
def update_prompt(self): def update_prompt(self):
"""Update prompt.""" """Update prompt."""
try: try:
self.widget.set_prompt(self.data['local_variables']['nick']) self.widget.set_prompt(self.data['local_variables']['nick'])
except: except: # noqa: E722
self.widget.set_prompt(None) self.widget.set_prompt(None)
def input_text_sent(self, text): def input_text_sent(self, text):

View File

@ -329,7 +329,7 @@ class MainWindow(QtGui.QMainWindow):
forcecolor='#008800') forcecolor='#008800')
self.debug_display(0, '', 'Message: %s' % message) self.debug_display(0, '', 'Message: %s' % message)
self.parse_message(message) self.parse_message(message)
except: except: # noqa: E722
print('Error while decoding message from WeeChat:\n%s' print('Error while decoding message from WeeChat:\n%s'
% traceback.format_exc()) % traceback.format_exc())
self.network.disconnect_weechat() self.network.disconnect_weechat()

View File

@ -91,7 +91,7 @@ class Color():
try: try:
index = int(color) index = int(color)
return '\x01(Fr%s)' % self.color_options[index] return '\x01(Fr%s)' % self.color_options[index]
except: except: # noqa: E722
print('Error decoding WeeChat color "%s"' % color) print('Error decoding WeeChat color "%s"' % color)
return '' return ''
@ -99,7 +99,7 @@ class Color():
try: try:
index = int(color) index = int(color)
return '\x01(%s%s#%s)' % (fg_bg, attrs, self._rgb_color(index)) return '\x01(%s%s#%s)' % (fg_bg, attrs, self._rgb_color(index))
except: except: # noqa: E722
print('Error decoding terminal color "%s"' % color) print('Error decoding terminal color "%s"' % color)
return '' return ''
@ -122,7 +122,7 @@ class Color():
index = int(color) index = int(color)
return self._convert_terminal_color(fg_bg, attrs, return self._convert_terminal_color(fg_bg, attrs,
WEECHAT_BASIC_COLORS[index][1]) WEECHAT_BASIC_COLORS[index][1])
except: except: # noqa: E722
print('Error decoding color "%s"' % color) print('Error decoding color "%s"' % color)
return '' return ''

View File

@ -61,7 +61,7 @@ class TestProto(object):
try: try:
self.sock = socket.socket(inet, socket.SOCK_STREAM) self.sock = socket.socket(inet, socket.SOCK_STREAM)
self.sock.connect((self.args.hostname, self.args.port)) self.sock.connect((self.args.hostname, self.args.port))
except: except: # noqa: E722
if self.sock: if self.sock:
self.sock.close() self.sock.close()
print('Failed to connect to', self.address) print('Failed to connect to', self.address)
@ -80,7 +80,7 @@ class TestProto(object):
self.has_quit = True self.has_quit = True
self.sock.sendall(msg + '\n') self.sock.sendall(msg + '\n')
print('\x1b[33m<-- ' + msg + '\x1b[0m') print('\x1b[33m<-- ' + msg + '\x1b[0m')
except: except: # noqa: E722
traceback.print_exc() traceback.print_exc()
print('Failed to send message') print('Failed to send message')
return False return False
@ -105,7 +105,7 @@ class TestProto(object):
protocol.hex_and_ascii(msgd.uncompressed, 20))) protocol.hex_and_ascii(msgd.uncompressed, 20)))
# display decoded message # display decoded message
print('\x1b[32m--> {0}\x1b[0m'.format(msgd)) print('\x1b[32m--> {0}\x1b[0m'.format(msgd))
except: except: # noqa: E722
traceback.print_exc() traceback.print_exc()
print('Error while decoding message from WeeChat') print('Error while decoding message from WeeChat')
return False return False
@ -181,7 +181,7 @@ class TestProto(object):
recvbuf = '' recvbuf = ''
sys.stdout.write(prompt + message) sys.stdout.write(prompt + message)
sys.stdout.flush() sys.stdout.flush()
except: except: # noqa: E722
traceback.print_exc() traceback.print_exc()
self.send('quit') self.send('quit')
return 0 return 0