Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
9cd576eb by lovetox at 2020-03-10T21:41:31+01:00
Fix pylint errors
- trailing-newlines
- chained-comparison
- trailing-whitespace
- unnecessary-pass
- - - - -
5 changed files:
- nbxmpp/idlequeue.py
- nbxmpp/old_dispatcher.py
- nbxmpp/protocol.py
- nbxmpp/simplexml.py
- nbxmpp/stringprepare.py
Changes:
=====================================
nbxmpp/idlequeue.py
=====================================
@@ -86,25 +86,21 @@ class IdleObject:
"""
Called on stream failure
"""
- pass
def pollin(self):
"""
Called on new read event
"""
- pass
def pollout(self):
"""
Called on new write event (connect in sockets is a pollout)
"""
- pass
def read_timeout(self):
"""
Called when timeout happened
"""
- pass
class IdleCommand(IdleObject):
=====================================
nbxmpp/old_dispatcher.py
=====================================
@@ -458,7 +458,6 @@ class XMPPDispatcher(PlugIn):
log.warning(
'Unregister failed: %s for "%s" type->%s ns->%s(%s)',
handler, name, typ, ns, xmlns)
- pass
def RegisterDefaultHandler(self, handler):
"""
=====================================
nbxmpp/protocol.py
=====================================
@@ -592,13 +592,11 @@ class NodeProcessed(Exception):
Exception that should be raised by handler when the handling should be
stopped
"""
- pass
class StreamError(Exception):
"""
Base exception class for stream errors
"""
- pass
class BadFormat(StreamError):
pass
@@ -2209,4 +2207,3 @@ class DataForm(Node):
Simple dictionary interface for setting datafields values by their names
"""
return self.setField(name).setValue(val)
-
=====================================
nbxmpp/simplexml.py
=====================================
@@ -93,7 +93,7 @@ class Node:
self.nsp_cache = {}
if nsp:
for k, v in nsp.items(): self.nsp_cache[k] = v
-
+
if attrs is not None:
for attr, val in attrs.items():
if attr == 'xmlns':
@@ -688,7 +688,6 @@ class NodeBuilder:
up with the built node as argument. Can be redefined to convert incoming
XML stanzas to program events
"""
- pass
def stream_header_received(self):
"""
@@ -706,7 +705,7 @@ class NodeBuilder:
"""
Return True if at least one end tag was seen (at level)
"""
- return self.__depth <= level and self.__max_depth > level
+ return self.__depth <= level < self.__max_depth
def _inc_depth(self):
self.__last_depth = self.__depth
=====================================
nbxmpp/stringprepare.py
=====================================
@@ -35,7 +35,6 @@ class ILookupTable:
"""
Return whether character is in this table
"""
- pass
class IMappingTable:
@@ -47,7 +46,6 @@ class IMappingTable:
"""
Return mapping for character
"""
- pass
class LookupTableFromFunction:
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/9cd576ebf095652ee8d8f605…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/9cd576ebf095652ee8d8f605…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
5e326b3e by lovetox at 2020-03-10T21:20:35+01:00
Update .pylintrc
- - - - -
a89e9a52 by lovetox at 2020-03-10T21:26:04+01:00
Remove unused imports
- - - - -
6afd49a5 by lovetox at 2020-03-10T21:30:28+01:00
Fix pylint errors
- - - - -
234379a6 by lovetox at 2020-03-10T21:31:25+01:00
Fix undefined var
- - - - -
6 changed files:
- .pylintrc
- nbxmpp/connection.py
- nbxmpp/old_dispatcher.py
- nbxmpp/resolver.py
- nbxmpp/util.py
- nbxmpp/websocket.py
Changes:
=====================================
.pylintrc
=====================================
@@ -50,7 +50,9 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
-disable=C0111,C0301,R1710,R0912,R0914,R0915,W0511,W0231,W0233
+# C0111 missing-docstring
+# W0511 fix-me
+disable=C0111,W0511
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
@@ -94,7 +96,7 @@ max-nested-blocks=5
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
-additional-builtins=_
+additional-builtins=
# Tells whether unused global variables should be treated as a violation.
allow-global-unused-variables=yes
@@ -138,7 +140,7 @@ ignore-mixin-members=yes
# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
-ignored-classes=optparse.Values,thread._local,_thread._local
+ignored-classes=optparse.Values,thread._local,_thread._local,gi.repository.GLib.Error
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
@@ -220,10 +222,10 @@ indent-after-paren=4
indent-string=' '
# Maximum number of characters on a single line.
-max-line-length=100
+max-line-length=80
# Maximum number of lines in a module
-max-module-lines=1000
+max-module-lines=3000
# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
@@ -357,7 +359,7 @@ known-third-party=enchant
[DESIGN]
# Maximum number of arguments for function / method
-max-args=10
+max-args=15
# Maximum number of attributes for a class (see R0902).
max-attributes=9999
@@ -366,22 +368,22 @@ max-attributes=9999
max-bool-expr=5
# Maximum number of branch for function / method body
-max-branches=12
+max-branches=50
# Maximum number of locals for function / method body
-max-locals=15
+max-locals=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of public methods for a class (see R0904).
-max-public-methods=20
+max-public-methods=50
# Maximum number of return / yield for function / method body
max-returns=100
# Maximum number of statements in function / method body
-max-statements=50
+max-statements=100
# Minimum number of public methods for a class (see R0903).
min-public-methods=0
=====================================
nbxmpp/connection.py
=====================================
@@ -88,12 +88,12 @@ class Connection(Observable):
if self._ignored_tls_errors:
log.warning('Ignore TLS certificate errors: %s',
- self._ignored_tls_errors)
+ self._ignored_tls_errors)
self._peer_certificate_errors -= self._ignored_tls_errors
if Gio.TlsCertificateFlags.UNKNOWN_CA in self._peer_certificate_errors:
for accepted_certificate in self._accepted_certificates:
- if certificate.is_same(accepted_certificate):
+ if self._peer_certificate.is_same(accepted_certificate):
self._peer_certificate_errors.discard(
Gio.TlsCertificateFlags.UNKNOWN_CA)
break
=====================================
nbxmpp/old_dispatcher.py
=====================================
@@ -20,7 +20,6 @@ different handlers to different XMPP stanzas and namespaces
"""
import sys
-import locale
import re
import uuid
import logging
=====================================
nbxmpp/resolver.py
=====================================
@@ -127,6 +127,7 @@ class GioResolver(metaclass=Singleton):
for result in result_list:
if result.startswith('_xmpp-client-websocket'):
return result.split('=')[1]
+ return None
if __name__ == '__main__':
=====================================
nbxmpp/util.py
=====================================
@@ -21,7 +21,6 @@ import weakref
import hashlib
import uuid
import binascii
-import ipaddress
import os
import re
from collections import defaultdict
@@ -29,7 +28,6 @@ from collections import defaultdict
from functools import wraps
from functools import lru_cache
-import precis_i18n.codec
from gi.repository import Gio
from nbxmpp.protocol import DiscoInfoMalformed
@@ -37,7 +35,6 @@ from nbxmpp.protocol import isErrorNode
from nbxmpp.protocol import NS_DATA
from nbxmpp.protocol import NS_HTTPUPLOAD_0
from nbxmpp.const import GIO_TLS_ERRORS
-from nbxmpp.const import StreamState
from nbxmpp.protocol import NS_STREAMS
from nbxmpp.protocol import NS_CLIENT
from nbxmpp.protocol import NS_FRAMING
=====================================
nbxmpp/websocket.py
=====================================
@@ -128,7 +128,7 @@ class WebsocketConnection(Connection):
def _on_websocket_closing(_websocket):
log.info('Closing')
- def _on_websocket_error(self, websocket, error):
+ def _on_websocket_error(self, _websocket, error):
log.error(error)
if self._state not in (TCPState.DISCONNECTED, TCPState.DISCONNECTING):
self._finalize('disconnected')
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/6113c4f50de7509563e57ba…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/6113c4f50de7509563e57ba…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
4f4624e0 by Philipp Hörist at 2020-02-03T21:13:12+01:00
Add dedicated connection state variable
- - - - -
46a00a6a by Philipp Hörist at 2020-02-03T21:51:15+01:00
Remove invisible feature
- This feature stems from the single device age
- Depends on deprecated Privacy Lists (XEP-0016)
- No support in other clients makes it in the current multiple device world useless
- Hard to maintain, prevents us to use even basic features like MUC because it would leak presence
- - - - -
30 changed files:
- gajim/chat_control_base.py
- gajim/command_system/implementation/standard.py
- gajim/common/app.py
- gajim/common/config.py
- gajim/common/connection.py
- gajim/common/const.py
- gajim/common/contacts.py
- gajim/common/dbus/logind.py
- gajim/common/helpers.py
- gajim/common/jingle_session.py
- gajim/common/modules/bookmarks.py
- gajim/common/modules/entity_time.py
- gajim/common/modules/muc.py
- gajim/common/modules/presence.py
- gajim/common/modules/privacylists.py
- gajim/common/modules/vcard_temp.py
- gajim/common/zeroconf/connection_handlers_zeroconf.py
- gajim/common/zeroconf/connection_zeroconf.py
- gajim/data/gui/preferences_window.ui
- gajim/data/gui/roster_window.ui
- − gajim/data/icons/hicolor/16x16/status/dcraven-invisible.png
- − gajim/data/icons/hicolor/16x16/status/gadu-invisible.png
- − gajim/data/icons/hicolor/16x16/status/gnome-invisible.png
- − gajim/data/icons/hicolor/16x16/status/goojim-invisible.png
- − gajim/data/icons/hicolor/16x16/status/gota-invisible.png
- − gajim/data/icons/hicolor/16x16/status/jabberbulb-invisible.png
- − gajim/data/icons/hicolor/16x16/status/sun-invisible.png
- − gajim/data/icons/hicolor/16x16/status/wroop-invisible.png
- − gajim/data/icons/hicolor/32x32/status/dcraven-invisible.png
- − gajim/data/icons/hicolor/32x32/status/gadu-invisible.png
The diff was not included because it is too large.
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/adef78c5ee7fea63ea5973e63aeb45340…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/adef78c5ee7fea63ea5973e63aeb45340…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
3512e2f9 by Philipp Hörist at 2020-02-02T16:58:29+01:00
Set encryption attribute on HTTPUpload and Groupchat messages
This fixes an regression from the send message refactor
- - - - -
2 changed files:
- gajim/common/modules/httpupload.py
- gajim/groupchat_control.py
Changes:
=====================================
gajim/common/modules/httpupload.py
=====================================
@@ -244,7 +244,8 @@ class HTTPUpload(BaseModule):
jid=transfer.contact.jid,
message=uri,
type_=type_,
- oob_url=uri)
+ oob_url=uri,
+ encryption=transfer.encryption)
self._con.send_message(message)
=====================================
gajim/groupchat_control.py
=====================================
@@ -1591,7 +1591,8 @@ class GroupchatControl(ChatControlBase):
type_='groupchat',
label=label,
chatstate=chatstate,
- correct_id=correct_id)
+ correct_id=correct_id,
+ encryption=self.encryption)
message_.additional_data.set_value('gajim', 'xhtml', xhtml)
con.send_message(message_)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3512e2f9c0ac9fe312695635fa64352f02…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3512e2f9c0ac9fe312695635fa64352f02…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
37f5d46a by Philipp Hörist at 2020-02-02T09:02:16+01:00
Smacks: Fix parsing error text on failed resume
- - - - -
1 changed file:
- nbxmpp/smacks.py
Changes:
=====================================
nbxmpp/smacks.py
=====================================
@@ -270,7 +270,7 @@ class Smacks(PlugIn):
stanza.getAttr('h'))
self._validate_ack(stanza, self._old_uqueue)
else:
- for tag in stanza.getTags():
+ for tag in stanza.getChildren():
if tag.getName() != 'text':
log.info(tag.getName())
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/37f5d46ac7529222f15be29781…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/37f5d46ac7529222f15be29781…
You're receiving this email because of your account on dev.gajim.org.