Philipp Hörist pushed to branch master at gajim / gajim

Commits:

18 changed files:

Changes:

  • gajim/chat_control_base.py
    ... ... @@ -75,7 +75,7 @@ from gajim.command_system.implementation import execute
    75 75
     # pylint: enable=unused-import
    
    76 76
     
    
    77 77
     if app.is_installed('GSPELL'):
    
    78
    -    from gi.repository import Gspell
    
    78
    +    from gi.repository import Gspell  # pylint: disable=ungrouped-imports
    
    79 79
     
    
    80 80
     
    
    81 81
     ################################################################################
    

  • gajim/common/caps_cache.py
    ... ... @@ -29,10 +29,8 @@ through ClientCaps objects which are hold by contact instances.
    29 29
     
    
    30 30
     import base64
    
    31 31
     import hashlib
    
    32
    -from collections import namedtuple
    
    33
    -
    
    34 32
     import logging
    
    35
    -log = logging.getLogger('gajim.c.caps_cache')
    
    33
    +from collections import namedtuple
    
    36 34
     
    
    37 35
     import nbxmpp
    
    38 36
     from nbxmpp.const import Affiliation
    
    ... ... @@ -44,6 +42,8 @@ FEATURE_BLACKLIST = [NS_CHATSTATES, NS_XHTML_IM, NS_ESESSION,
    44 42
         NS_JINGLE_ICE_UDP, NS_JINGLE_RTP_AUDIO, NS_JINGLE_RTP_VIDEO,
    
    45 43
         NS_JINGLE_FILE_TRANSFER_5]
    
    46 44
     
    
    45
    +log = logging.getLogger('gajim.c.caps_cache')
    
    46
    +
    
    47 47
     # Query entry status codes
    
    48 48
     NEW = 0
    
    49 49
     QUERIED = 1
    

  • gajim/common/connection.py
    ... ... @@ -32,7 +32,7 @@ import sys
    32 32
     import random
    
    33 33
     import socket
    
    34 34
     import operator
    
    35
    -import string
    
    35
    +
    
    36 36
     import time
    
    37 37
     import hashlib
    
    38 38
     import json
    
    ... ... @@ -40,13 +40,13 @@ import logging
    40 40
     import base64
    
    41 41
     import ssl
    
    42 42
     from functools import partial
    
    43
    +import string
    
    43 44
     from string import Template
    
    44 45
     from urllib.request import urlopen
    
    45 46
     from urllib.error import URLError
    
    46 47
     
    
    47 48
     from gi.repository import GLib
    
    48
    -if sys.platform in ('win32', 'darwin'):
    
    49
    -    import certifi
    
    49
    +
    
    50 50
     import OpenSSL.crypto
    
    51 51
     import nbxmpp
    
    52 52
     from nbxmpp.const import Realm
    
    ... ... @@ -76,6 +76,9 @@ from gajim.common.connection_handlers_events import NewAccountConnectedEvent
    76 76
     from gajim.common.connection_handlers_events import NewAccountNotConnectedEvent
    
    77 77
     from gajim.common.connection_handlers_events import MessageSentEvent
    
    78 78
     
    
    79
    +if sys.platform in ('win32', 'darwin'):
    
    80
    +    import certifi
    
    81
    +
    
    79 82
     
    
    80 83
     log = logging.getLogger('gajim.c.connection')
    
    81 84
     
    

  • gajim/common/dbus/location.py
    ... ... @@ -23,7 +23,7 @@ from nbxmpp.structs import LocationData
    23 23
     from gajim.common import app
    
    24 24
     
    
    25 25
     if app.is_installed('GEOCLUE'):
    
    26
    -    from gi.repository import Geoclue
    
    26
    +    from gi.repository import Geoclue  # pylint: disable=ungrouped-imports
    
    27 27
     
    
    28 28
     log = logging.getLogger('gajim.c.dbus.location')
    
    29 29
     
    

  • gajim/common/jingle_ftstates.py
    ... ... @@ -12,12 +12,14 @@
    12 12
     # You should have received a copy of the GNU General Public License
    
    13 13
     # along with Gajim. If not, see <http://www.gnu.org/licenses/>.
    
    14 14
     
    
    15
    +import logging
    
    16
    +
    
    15 17
     import nbxmpp
    
    16 18
     from gajim.common import app
    
    17 19
     from gajim.common.jingle_transport import TransportType
    
    18
    -from gajim.common.socks5 import Socks5ReceiverClient, Socks5SenderClient
    
    20
    +from gajim.common.socks5 import Socks5ReceiverClient
    
    21
    +from gajim.common.socks5 import Socks5SenderClient
    
    19 22
     
    
    20
    -import logging
    
    21 23
     log = logging.getLogger('gajim.c.jingle_ftstates')
    
    22 24
     
    
    23 25
     
    

  • gajim/common/jingle_rtp.py
    ... ... @@ -18,22 +18,22 @@ Handles Jingle RTP sessions (XEP 0167)
    18 18
     
    
    19 19
     import logging
    
    20 20
     import socket
    
    21
    +from collections import deque
    
    22
    +
    
    21 23
     import nbxmpp
    
    22
    -import gi
    
    23 24
     from gi.repository import Farstream
    
    24
    -
    
    25
    -gi.require_version('Gst', '1.0')
    
    26 25
     from gi.repository import Gst
    
    27 26
     from gi.repository import GLib
    
    28 27
     
    
    29 28
     from gajim.common import app
    
    30 29
     from gajim.common.i18n import _
    
    31 30
     from gajim.common.jingle_transport import JingleTransportICEUDP
    
    32
    -from gajim.common.jingle_content import contents, JingleContent, JingleContentSetupException
    
    31
    +from gajim.common.jingle_content import contents
    
    32
    +from gajim.common.jingle_content import JingleContent
    
    33
    +from gajim.common.jingle_content import JingleContentSetupException
    
    33 34
     from gajim.common.connection_handlers_events import InformationEvent
    
    34 35
     from gajim.common.jingle_session import FailedApplication
    
    35 36
     
    
    36
    -from collections import deque
    
    37 37
     
    
    38 38
     log = logging.getLogger('gajim.c.jingle_rtp')
    
    39 39
     
    

  • gajim/common/modules/base.py
    ... ... @@ -85,4 +85,4 @@ class BaseModule:
    85 85
             if self._stored_publish is None:
    
    86 86
                 return
    
    87 87
             self._log.info('Send stored publish')
    
    88
    -        self._stored_publish()
    88
    +        self._stored_publish()  # pylint: disable=not-callable

  • gajim/common/multimedia_helpers.py
    ... ... @@ -14,9 +14,8 @@
    14 14
     # You should have received a copy of the GNU General Public License
    
    15 15
     # along with Gajim. If not, see <http://www.gnu.org/licenses/>.
    
    16 16
     
    
    17
    -import gi
    
    18 17
     import logging
    
    19
    -gi.require_version('Gst', '1.0')
    
    18
    +
    
    20 19
     from gi.repository import Gst
    
    21 20
     
    
    22 21
     from gajim.common.i18n import _
    

  • gajim/common/protocol/bytestream.py
    ... ... @@ -26,10 +26,12 @@
    26 26
     
    
    27 27
     import socket
    
    28 28
     import base64
    
    29
    -from gi.repository import GLib
    
    30 29
     import time
    
    30
    +import logging
    
    31 31
     
    
    32 32
     import nbxmpp
    
    33
    +from gi.repository import GLib
    
    34
    +
    
    33 35
     from gajim.common import app
    
    34 36
     from gajim.common import helpers
    
    35 37
     from gajim.common import ged
    
    ... ... @@ -37,7 +39,7 @@ from gajim.common import jingle_xtls
    37 39
     from gajim.common.file_props import FilesProp
    
    38 40
     from gajim.common.socks5 import Socks5SenderClient
    
    39 41
     
    
    40
    -import logging
    
    42
    +
    
    41 43
     log = logging.getLogger('gajim.c.p.bytestream')
    
    42 44
     
    
    43 45
     def is_transfer_paused(file_props):
    

  • gajim/common/proxy65_manager.py
    ... ... @@ -20,15 +20,17 @@ import socket
    20 20
     import struct
    
    21 21
     import errno
    
    22 22
     import logging
    
    23
    -log = logging.getLogger('gajim.c.proxy65_manager')
    
    24 23
     
    
    25 24
     import nbxmpp
    
    25
    +from nbxmpp.idlequeue import IdleObject
    
    26
    +
    
    26 27
     from gajim.common import app
    
    27 28
     from gajim.common import helpers
    
    28 29
     from gajim.common.socks5 import Socks5
    
    29
    -from nbxmpp.idlequeue import IdleObject
    
    30 30
     from gajim.common.file_props import FilesProp
    
    31 31
     
    
    32
    +log = logging.getLogger('gajim.c.proxy65_manager')
    
    33
    +
    
    32 34
     S_INITIAL = 0
    
    33 35
     S_STARTED = 1
    
    34 36
     S_RESOLVED = 2
    

  • gajim/conversation_textview.py
    ... ... @@ -805,10 +805,10 @@ class ConversationTextview(GObject.GObject):
    805 805
                     emoji_pixbufs.append_marks(
    
    806 806
                         self.tv, start_mark, end_mark, special_text)
    
    807 807
     
    
    808
    -        elif special_text.startswith('www.') or \
    
    809
    -            special_text.startswith('ftp.') or \
    
    810
    -            text_is_valid_uri and not is_xhtml_link:
    
    811
    -                tags.append('url')
    
    808
    +        elif (special_text.startswith('www.') or
    
    809
    +              special_text.startswith('ftp.') or
    
    810
    +              text_is_valid_uri and not is_xhtml_link):
    
    811
    +            tags.append('url')
    
    812 812
             elif special_text.startswith('mailto:') and not is_xhtml_link:
    
    813 813
                 tags.append('mail')
    
    814 814
             elif special_text.startswith('xmpp:') and not is_xhtml_link:
    

  • gajim/dev/ipython_view.py
    ... ... @@ -60,8 +60,10 @@ except ImportError:
    60 60
     HAS_IPYTHON5 = True
    
    61 61
     try:
    
    62 62
         from pygments.token import Token
    
    63
    +    # pylint: disable=ungrouped-imports
    
    63 64
         from IPython.core.displayhook import DisplayHook
    
    64 65
         from IPython.core.display_trap import DisplayTrap
    
    66
    +    # pylint: enable=ungrouped-imports
    
    65 67
     
    
    66 68
         class MyPromptDisplayHook(DisplayHook):
    
    67 69
             def __init__(self, shell, view):
    

  • gajim/groupchat_control.py
    ... ... @@ -1158,7 +1158,7 @@ class GroupchatControl(ChatControlBase):
    1158 1158
             if self.form_widget:
    
    1159 1159
                 self.form_widget.hide()
    
    1160 1160
                 self.form_widget.destroy()
    
    1161
    -            self.btn_box.destroy()
    
    1161
    +            self.btn_box.destroy()  # pylint: disable=access-member-before-definition
    
    1162 1162
     
    
    1163 1163
             self.form_widget = DataFormWidget(event.form)
    
    1164 1164
     
    

  • gajim/gtk/preferences.py
    ... ... @@ -47,7 +47,7 @@ except (ImportError, ValueError):
    47 47
         HAS_GST = False
    
    48 48
     
    
    49 49
     if app.is_installed('GSPELL'):
    
    50
    -    from gi.repository import Gspell
    
    50
    +    from gi.repository import Gspell  # pylint: disable=ungrouped-imports
    
    51 51
     
    
    52 52
     
    
    53 53
     class Preferences(Gtk.ApplicationWindow):
    

  • gajim/gtk/single_message.py
    ... ... @@ -34,7 +34,7 @@ from gajim.gtk.util import move_window
    34 34
     from gajim.gtk.util import resize_window
    
    35 35
     
    
    36 36
     if app.is_installed('GSPELL'):
    
    37
    -    from gi.repository import Gspell
    
    37
    +    from gi.repository import Gspell  # pylint: disable=ungrouped-imports
    
    38 38
     
    
    39 39
     
    
    40 40
     class SingleMessageWindow:
    

  • gajim/history_manager.py
    ... ... @@ -32,11 +32,6 @@ import getopt
    32 32
     import sqlite3
    
    33 33
     from enum import IntEnum, unique
    
    34 34
     
    
    35
    -import gi
    
    36
    -gi.require_version('Gtk', '3.0')
    
    37
    -gi.require_version('GLib', '2.0')
    
    38
    -gi.require_version('Gdk', '3.0')
    
    39
    -gi.require_version('Gio', '2.0')
    
    40 35
     from gi.repository import Gtk
    
    41 36
     from gi.repository import Gdk
    
    42 37
     from gi.repository import GLib
    
    ... ... @@ -85,6 +80,7 @@ if is_standalone():
    85 80
         configpaths.init()
    
    86 81
         app.load_css_config()
    
    87 82
     
    
    83
    +# pylint: disable=C0413
    
    88 84
     from gajim.common import helpers
    
    89 85
     from gajim.gtk.dialogs import YesNoDialog
    
    90 86
     from gajim.gtk.dialogs import ErrorDialog
    
    ... ... @@ -94,7 +90,7 @@ from gajim.gtk.filechoosers import FileSaveDialog
    94 90
     from gajim.gtk.util import convert_rgb_to_hex
    
    95 91
     from gajim.gtk.util import get_builder
    
    96 92
     from gajim.gtk.util import get_app_icon_list
    
    97
    -
    
    93
    +# pylint: enable=C0413
    
    98 94
     
    
    99 95
     @unique
    
    100 96
     class Column(IntEnum):
    

  • gajim/message_textview.py
    ... ... @@ -31,7 +31,7 @@ from gajim.common.const import StyleAttr
    31 31
     from gajim.gtk.util import scroll_to_end
    
    32 32
     
    
    33 33
     if app.is_installed('GSPELL'):
    
    34
    -    from gi.repository import Gspell
    
    34
    +    from gi.repository import Gspell  # pylint: disable=ungrouped-imports
    
    35 35
     
    
    36 36
     
    
    37 37
     class MessageTextView(Gtk.TextView):
    

  • scripts/dev/pylint-ci.sh
    1 1
     #!/bin/sh
    
    2 2
     PYLINT=${PYLINT:-pylint}
    
    3 3
     
    
    4
    -"$PYLINT" --disable=C0103,C0302,C0301,C0330,C0411,C0412,C0413,E0203,E0401,E0611,E0710,E0712,E1101,E1102,E1133,E1136,R0201,R0901,R0904,R0912,R0913,R0914,R0915,R0916,R1702,R1710,W0201,W0212,W0221,W0223,W0231,W0233,W0311,W0401,W0603,W0613 "$@"
    
    4
    +"$PYLINT" --disable=C0103,C0302,C0301,C0330,E0401,E0611,E0710,E0712,E1101,E1133,E1136,R0201,R0901,R0904,R0912,R0913,R0914,R0915,R0916,R1702,R1710,W0201,W0212,W0221,W0223,W0231,W0233,W0603,W0613 "$@"
    
    5 5
     
    
    6 6
     # C0103 invalid-name
    
    7 7
     # C0301 line-too-long
    
    8 8
     # C0302 too-many-lines
    
    9 9
     # C0330 bad-continuation
    
    10
    -# C0411 wrong-import-order
    
    11
    -# C0412 ungrouped-imports
    
    12
    -# C0413 wrong-import-position
    
    13
    -# E0203 access-member-before-definition
    
    14 10
     # E0401 import-error
    
    15 11
     # E0611 no-name-in-module
    
    16 12
     # E0710 raising-non-exception   - GLib.GError is not recognized
    
    17 13
     # E0712 catching-non-exception  - GLib.GError is not recognized
    
    18 14
     # E1101 no-member
    
    19
    -# E1102 not-callable
    
    20 15
     # E1133 not-an-iterable
    
    21 16
     # E1136 unsubscriptable-object
    
    22 17
     # R0201 no-self-use
    
    ... ... @@ -35,7 +30,5 @@ PYLINT=${PYLINT:-pylint}
    35 30
     # W0223 abstract-method
    
    36 31
     # W0231 super-init-not-called
    
    37 32
     # W0233 non-parent-init-called
    
    38
    -# W0311 bad-indentation
    
    39
    -# W0401 wildcard-import
    
    40 33
     # W0603 global-statement
    
    41 34
     # W0613 unused-argument