Fix assignment-from-none pylint errors
This commit is contained in:
parent
ee38f76004
commit
1c39d66d21
5 changed files with 14 additions and 17 deletions
|
@ -497,7 +497,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
|
||||||
item = Gtk.SeparatorMenuItem.new()
|
item = Gtk.SeparatorMenuItem.new()
|
||||||
menu.prepend(item)
|
menu.prepend(item)
|
||||||
|
|
||||||
menu2 = self.prepare_context_menu()
|
menu2 = self.prepare_context_menu() # pylint: disable=assignment-from-none
|
||||||
i = 0
|
i = 0
|
||||||
for item in menu2:
|
for item in menu2:
|
||||||
menu2.remove(item)
|
menu2.remove(item)
|
||||||
|
|
|
@ -113,14 +113,16 @@ class OptionsParser:
|
||||||
app.config.foreach(self.write_line, file)
|
app.config.foreach(self.write_line, file)
|
||||||
except IOError:
|
except IOError:
|
||||||
log.exception('Failed to write config file')
|
log.exception('Failed to write config file')
|
||||||
return
|
return False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
temp_filepath.replace(config_path)
|
temp_filepath.replace(config_path)
|
||||||
except Exception:
|
except Exception:
|
||||||
log.exception('Failed to replace config file')
|
log.exception('Failed to replace config file')
|
||||||
else:
|
return False
|
||||||
|
|
||||||
log.info('Successful saved config file')
|
log.info('Successful saved config file')
|
||||||
|
return True
|
||||||
|
|
||||||
def update_config(self, old_version, new_version):
|
def update_config(self, old_version, new_version):
|
||||||
old_version_list = old_version.split('.') # convert '0.x.y' to (0, x, y)
|
old_version_list = old_version.split('.') # convert '0.x.y' to (0, x, y)
|
||||||
|
|
|
@ -1297,8 +1297,7 @@ class Socks5Client(Socks5):
|
||||||
return
|
return
|
||||||
if self.state < 5:
|
if self.state < 5:
|
||||||
self.idlequeue.set_read_timeout(self.fd, CONNECT_TIMEOUT)
|
self.idlequeue.set_read_timeout(self.fd, CONNECT_TIMEOUT)
|
||||||
result = self.main(0)
|
self.main(0)
|
||||||
self.queue.process_result(result, self)
|
|
||||||
elif self.state == 5: # wait for proxy reply
|
elif self.state == 5: # wait for proxy reply
|
||||||
pass
|
pass
|
||||||
elif self.file_props.type_ == 'r':
|
elif self.file_props.type_ == 'r':
|
||||||
|
|
|
@ -2038,15 +2038,12 @@ class Interface:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def save_config():
|
def save_config():
|
||||||
err_str = parser.write()
|
if parser.write():
|
||||||
if err_str is not None:
|
return
|
||||||
print(err_str, file=sys.stderr)
|
|
||||||
# it is good to notify the user
|
error_dialog = ErrorDialog(
|
||||||
# in case he or she cannot see the output of the console
|
_('Could not save your settings and preferences'))
|
||||||
error_dialog = ErrorDialog(_('Could not save your settings and '
|
|
||||||
'preferences'), err_str)
|
|
||||||
error_dialog.run()
|
error_dialog.run()
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def update_avatar(account=None, jid=None, contact=None, room_avatar=False):
|
def update_avatar(account=None, jid=None, contact=None, room_avatar=False):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
PYLINT=${PYLINT:-pylint}
|
PYLINT=${PYLINT:-pylint}
|
||||||
|
|
||||||
"$PYLINT" --disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1128,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614 "$@"
|
"$PYLINT" --disable=C0103,C0302,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1133,E1136,R0201,R0901,R0904,R0913,R0916,R1702,W0201,W0212,W0221,W0223,W0311,W0401,W0603,W0613,W0614 "$@"
|
||||||
|
|
||||||
# C0103 invalid-name
|
# C0103 invalid-name
|
||||||
# C0302 too-many-lines
|
# C0302 too-many-lines
|
||||||
|
@ -16,7 +16,6 @@ PYLINT=${PYLINT:-pylint}
|
||||||
# E0712 catching-non-exception - GLib.GError is not recognized
|
# E0712 catching-non-exception - GLib.GError is not recognized
|
||||||
# E1101 no-member
|
# E1101 no-member
|
||||||
# E1102 not-callable
|
# E1102 not-callable
|
||||||
# E1128 assignment-from-none
|
|
||||||
# E1133 not-an-iterable
|
# E1133 not-an-iterable
|
||||||
# E1136 unsubscriptable-object
|
# E1136 unsubscriptable-object
|
||||||
# R0201 no-self-use
|
# R0201 no-self-use
|
||||||
|
|
Loading…
Add table
Reference in a new issue