A few pylint fixes
These are fixes for things discovered with the pylint tool. Gajim's functionality should be unchanged. The patches are against svn r10523.
001_pylint_W0106_remove_unnecessary_semicolons.patch
Rationale: Semicolons are fortunately not needed in python ;)
002_pylint_W0104_fix_statements_without_effect.patch
Removes some statements without effect. This should not have any effect :)
003_pylint_W0107_remove_unnecessary_pass_statements.patch
Removes some pass statements, which are preceded by other statements
004_pylint_W0101_fix_unreachable_code.patch
Removes / comments out some code after exceptions or return statements
005_pylint_E0102_fix_redefined_functions.patch
Removes a duplicate function in client_zeroconf.py
006_pylint_W0105_fix_string_statements_without_effect.patch
Fixes some module docstrings, which were not at the top of the module. Replaces unused strings with comments
Rationale: Uses less memory
007_pylint_W0611_remove_unused_imports.patch
Removes unnessecary imports.
008_pylint_E0602_fix_undefined_variables.patch
Fixes some typos, missing imports, not correctly prefixed statements, ...
009_pylint_W0602_fix_globals.patch
Removes some global statements, if the global is not getting assigned to.
010_pylint_W0612_fix_unused_variables.patch
Removes all assignments to variables, which do not get used later on. I.e. unsused exception variables, unused variables from tuple unpacking, ... Adds some missing global statements. Also some reimplementations, mostly list comprehensions which do not use the loop variable.
Rationale: Cleaner namespace, saves some cpu cycles.
011_pylint_W0622_fix_redefinded_builtins.patch
Replaces all redefined builtin symbols by builtin_.
Rationale: Maybe the most controversial change. Maybe it's ok in small functions to redefine builtins. I have decided to remove all redefinitions. Maybe a convention would be useful. I.e. iter -> iterator, list -> lst or something else, or the variables could be named after their content, and not their type.
012_pylint_W0631_fix_possibly_undefined_loop_variables.patch
Fixes the usage of loop variables outside of the loop. Contains reimplementations of the rfc2782 server selection mechanism and the function helpers.py:is_in_path. I did not know how to fix rosterwindow:2660: contact is always the last contact.
Rationale: I think it can be quite confusing to rely on this 'feature'.
013_pylint_E0203_fix_access_to_members_before_definition.patch
Adds some members which could be accessed before their definition.
014_pylint_E0213_add_self_as_first_argument_of_methods.patch
Adds one missing "self"
015_pylint_W0402_fix_deprecated_uses_of_the_string_module.patch
Removes one case of using the "split function" instead of the "split method"
016_pylint_W0404_fix_reimported_modules.patch
Removes some imports of already imported modules
017_pylint_W1010_fix_exceptions_not_inheriting_from_exception.patch
Rationale: Forbidden under Python 3
018_pylint_W0701_fix_string_exceptions.patch
Rationale: String exceptions have been removed from Python 3
019_pylint_W0702_fix_empty_except_clauses.patch
Remove the remaining empty except clauses.
020_pylint_W0311_fix_bad_indentation.patch
Some inconsistent indentations fixed
021_pylint_W0331_fix_unequal_operator.patch
Fix one remaining use of the "<>" operator
022_pylint_C0321_fix_more_than_one_statement_on_a_single_line.patch
Allow only one statement per line.
Rationale: Readablity counts.
diffstat:
advanced.py | 44 +-
cell_renderer_image.py | 12
chat_control.py | 224 ++++++-------
common/GnuPG.py | 37 +-
common/GnuPGInterface.py | 35 +-
common/atom.py | 6
common/caps.py | 27 -
common/check_paths.py | 1
common/commands.py | 14
common/config.py | 36 +-
common/connection.py | 100 +++---
common/connection_handlers.py | 204 ++++++------
common/dataforms.py | 61 ++-
common/defs.py | 2
common/gajim.py | 11
common/helpers.py | 49 +--
common/logger.py | 18 -
common/nslookup.py | 3
common/optparser.py | 14
common/passwords.py | 2
common/pep.py | 8
common/proxy65_manager.py | 13
common/pubsub.py | 18 -
common/rst_xhtml_generator.py | 2
common/sleepy.py | 1
common/socks5.py | 31 -
common/stanza_session.py | 28 -
common/xmpp/auth.py | 114 ++++---
common/xmpp/auth_nb.py | 65 ++--
common/xmpp/browser.py | 67 ++--
common/xmpp/c14n.py | 5
common/xmpp/client.py | 138 +++++---
common/xmpp/client_nb.py | 8
common/xmpp/commands.py | 38 +-
common/xmpp/debug.py | 103 +++---
common/xmpp/dispatcher.py | 160 ++++++---
common/xmpp/dispatcher_nb.py | 49 +--
common/xmpp/features.py | 138 +++++---
common/xmpp/features_nb.py | 49 +--
common/xmpp/filetransfer.py | 126 ++++---
common/xmpp/idlequeue.py | 3
common/xmpp/protocol.py | 301 ++++++++++++------
common/xmpp/roster.py | 62 ++-
common/xmpp/session.py | 113 ++++--
common/xmpp/simplexml.py | 209 ++++++++----
common/xmpp/transports.py | 86 +++--
common/xmpp/transports_nb.py | 91 +++--
common/zeroconf/client_zeroconf.py | 46 +-
common/zeroconf/connection_handlers_zeroconf.py | 35 +-
common/zeroconf/roster_zeroconf.py | 5
common/zeroconf/zeroconf.py | 6
common/zeroconf/zeroconf_avahi.py | 4
common/zeroconf/zeroconf_bonjour.py | 18 -
config.py | 388 +++++++++++-------------
conversation_textview.py | 323 ++++++++++---------
dataforms_widget.py | 38 +-
dialogs.py | 227 ++++++--------
disco.py | 229 +++++++-------
features_window.py | 14
filetransfers_window.py | 79 ++--
gajim-remote.py | 56 +--
gajim.py | 66 +---
gajim_themes_window.py | 42 +-
groupchat_control.py | 244 ++++++---------
groups.py | 6
gtkexcepthook.py | 4
gtkgui_helpers.py | 33 --
history_manager.py | 7
history_window.py | 4
htmltextview.py | 175 +++++-----
ipython_view.py | 30 -
lastfm.py | 18 -
message_control.py | 1
message_textview.py | 6
message_window.py | 42 +-
music_track_listener.py | 1
negotiation.py | 2
notify.py | 8
osx/growl/Growl.py | 8
osx/growler.py | 7
osx/syncmenu/setup.py | 3
osx/syncmenu/test-menu.py | 3
profile_window.py | 6
remote_control.py | 6
roster_window.py | 179 ++++-------
search_window.py | 18 -
secrets.py | 1
tooltips.py | 66 ++--
vcard.py | 11
89 files changed, 2877 insertions(+), 2514 deletions(-)