Jajcus avatar Jajcus committed 866b24a

pylinted

Comments (0)

Files changed (6)

pyxmpp2/client.py

         - `stream`: `clientstream.ClientStream`
         - `roster_client`: `RosterClient`
     """
-    # pylint: disable-msg=R0902
+    # pylint: disable=R0902,R0904
     def __init__(self, jid, handlers, settings = None, main_loop = None):
         """Initialize a Client object.
 
 def _initial_presence_factory(settings):
     """Factory for the :r:`initial_presence setting` default.
     """
+    # pylint: disable=W0613
     return Presence()
 
 XMPPSettings.add_setting(u"initial_presence",
         :Types:
             - `data`: `unicode`
 
-        :raise JIDError: if the domain name is too long."""
+        :raise JIDError: if the domain name is too long.
+        """
+        # pylint: disable=R0912
         if not data:
             raise JIDError("Domain must be given")
         data = unicode(data)
                 addr = _validate_ip_address(socket.AF_INET, data)
             except ValueError, err:
                 logger.debug("ValueError: {0}".format(err))
-                pass
         data = UNICODE_DOT_RE.sub(u".", data)
         data = data.rstrip(u".")
         labels = data.split(u".")

pyxmpp2/mainloop/glib.py

     @functools.wraps(method)
     def wrapper(self, *args, **kwargs):
         """Wrapper for methods decorated with `hold_exception`."""
-        # pylint: disable=W0703
+        # pylint: disable=W0703,W0212
         try:
             return method(self, *args, **kwargs)
         except Exception:

pyxmpp2/streambase.py

 
     @property
     def auth_properties(self):
+        """Authentication properties of the stream.
+
+        Derived from the transport with 'local-jid' and 'service-type' added.
+        """
         if self.transport:
             props = dict(self.transport.auth_properties)
         else:
             props = {}
-        props["local_jid"] = self.me
+        props["local-jid"] = self.me
         props["service-type"] = "xmpp"
         return props
 

pyxmpp2/test/resolver.py

 from socket import AF_INET, AF_INET6
 
 try:
-    import dns
-    HAVE_DNSPYTHON=True
+    import dns # pylint: disable=W0611
+    HAVE_DNSPYTHON = True
 except ImportError:
-    HAVE_DNSPYTHON=False
+    HAVE_DNSPYTHON = False
 
 from pyxmpp2.mainloop import main_loop_factory
 from pyxmpp2.mainloop.interfaces import Event
 logger = logging.getLogger("pyxmpp2.test.resolver")
 
 class _Const(object):
+    # pylint: disable=R0903
     def __init__(self, name):
         self.name = name
     def __str__(self):

pyxmpp2/transport.py

 import ssl
 
 try:
+    # pylint: disable=E0611
     from ssl import CHANNEL_BINDING_TYPES
 except ImportError:
     CHANNEL_BINDING_TYPES = []
 OUT_LOGGER = logging.getLogger("pyxmpp2.OUT")
 
 BLOCKING_ERRORS = set()
-for name in ['EAGAIN', 'EWOULDBLOCK', 'WSAEWOULDBLOCK', 'EINPROGRESS']:
-    if hasattr(errno, name):
-        BLOCKING_ERRORS.add(getattr(errno, name))
+for __name in ['EAGAIN', 'EWOULDBLOCK', 'WSAEWOULDBLOCK', 'EINPROGRESS']:
+    if hasattr(errno, __name):
+        BLOCKING_ERRORS.add(getattr(errno, __name))
 
 class WriteJob(object):
     """Base class for objects put to the `TCPTransport` write queue."""
         self._auth_properties['security-layer'] = "TLS"
         if "tls-unique" in CHANNEL_BINDING_TYPES:
             try:
+                # pylint: disable=E1103
                 tls_unique = self._socket.get_channel_binding("tls-unique")
             except ValueError:
                 pass
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.