Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gajim
python-nbxmpp
Commits
e80c9325
Commit
e80c9325
authored
Apr 02, 2022
by
Philipp Hörist
Browse files
ci: Fix Pylint errors
parent
a55e844c
Pipeline
#9621
passed with stages
in 47 seconds
Changes
15
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nbxmpp/auth.py
View file @
e80c9325
...
...
@@ -155,7 +155,7 @@ class SASL:
elif
chosen_mechanism
==
'ANONYMOUS'
:
self
.
_method
=
ANONYMOUS
(
self
.
_client
)
self
.
_method
.
initiate
()
self
.
_method
.
initiate
()
# pylint: disable=E1120
elif
chosen_mechanism
==
'EXTERNAL'
:
self
.
_method
=
EXTERNAL
(
self
.
_client
)
...
...
@@ -168,7 +168,7 @@ class SASL:
else
:
hostname
=
self
.
_client
.
domain
try
:
self
.
_method
.
initiate
(
hostname
)
self
.
_method
.
initiate
(
hostname
)
# pylint: disable=E1120
except
AuthFail
as
error
:
self
.
_log
.
error
(
error
)
self
.
_abort_auth
()
...
...
@@ -300,7 +300,7 @@ class GSSAPI:
if
not
self
.
ctx
.
complete
:
output_token
=
self
.
ctx
.
step
(
server_message
)
else
:
result
=
self
.
ctx
.
unwrap
(
server_message
)
_
result
=
self
.
ctx
.
unwrap
(
server_message
)
# TODO(jelmer): Log result.message
data
=
b
'
\x00\x00\x00\x00
'
+
bytes
(
self
.
ctx
.
initiator_name
)
output_token
=
self
.
ctx
.
wrap
(
data
,
False
).
message
...
...
nbxmpp/client.py
View file @
e80c9325
...
...
@@ -479,8 +479,8 @@ class Client(Observable):
else
:
self
.
_set_error
(
StreamError
.
CONNECTION_FAILED
,
'connection-failed'
,
(
f
'Unable to connect to last '
'successful address: {self._current_address}'
))
(
'Unable to connect to last '
f
'successful address:
{
self
.
_current_address
}
'
))
self
.
notify
(
'connection-failed'
)
def
_disconnect_with_error
(
self
,
error_domain
,
error
,
text
=
None
):
...
...
nbxmpp/errors.py
View file @
e80c9325
...
...
@@ -36,7 +36,7 @@ class BaseError(Exception):
def
__str__
(
self
)
->
str
:
return
self
.
text
def
get_text
(
self
,
pref_lang
:
Optional
[
str
]
=
None
)
->
str
:
def
get_text
(
self
,
_
pref_lang
:
Optional
[
str
]
=
None
)
->
str
:
return
self
.
text
...
...
nbxmpp/idlequeue.py
View file @
e80c9325
...
...
@@ -170,6 +170,8 @@ class IdleCommand(IdleObject):
def
_start_nt
(
self
):
# if program is started from noninteraactive shells stdin is closed and
# cannot be forwarded, so we have to keep it open
# pylint: disable=consider-using-with
self
.
pipe
=
subprocess
.
Popen
(
self
.
_compose_command_args
(),
stdout
=
subprocess
.
PIPE
,
bufsize
=
1024
,
...
...
nbxmpp/modules/blocking.py
View file @
e80c9325
...
...
@@ -17,8 +17,7 @@
from
__future__
import
annotations
from
typing
import
Literal
,
Optional
from
typing
import
Union
from
typing
import
Optional
from
typing
import
Set
from
typing
import
TYPE_CHECKING
...
...
nbxmpp/modules/discovery.py
View file @
e80c9325
...
...
@@ -57,7 +57,7 @@ class Discovery(BaseModule):
]
@
staticmethod
def
_process_disco_info
(
client
,
stanza
,
properties
):
def
_process_disco_info
(
client
,
stanza
,
_
properties
):
iq
=
stanza
.
buildReply
(
'error'
)
iq
.
addChild
(
node
=
ErrorNode
(
ERR_ITEM_NOT_FOUND
))
client
.
send_stanza
(
iq
)
...
...
nbxmpp/modules/muc/muc.py
View file @
e80c9325
...
...
@@ -208,7 +208,7 @@ class MUC(BaseModule):
if
address
is
not
None
:
properties
.
muc_ofrom
=
JID
.
from_string
(
address
.
getAttr
(
'jid'
))
def
_process_message_after_decryption
(
self
,
_client
,
stanza
,
properties
):
def
_process_message_after_decryption
(
self
,
_client
,
_
stanza
,
properties
):
if
properties
.
body
is
None
and
properties
.
subject
:
properties
.
muc_subject
=
MucSubject
(
text
=
properties
.
subject
,
...
...
@@ -444,7 +444,7 @@ class MUC(BaseModule):
@
iq_request_task
def
request_config
(
self
,
room_jid
):
task
=
yield
_
task
=
yield
response
=
yield
make_config_request
(
room_jid
)
if
response
.
isError
():
...
...
nbxmpp/modules/omemo.py
View file @
e80c9325
...
...
@@ -189,7 +189,7 @@ def _parse_omemo_message(stanza):
try
:
sid
=
int
(
header
.
getAttr
(
'sid'
))
except
Exception
as
error
:
except
Exception
:
raise
MalformedStanzaError
(
'sid attr not found'
,
stanza
)
iv_node
=
header
.
getTag
(
'iv'
)
...
...
nbxmpp/modules/ping.py
View file @
e80c9325
...
...
@@ -37,7 +37,7 @@ class Ping(BaseModule):
priority
=
15
),
]
def
_process_ping
(
self
,
_client
,
stanza
,
properties
):
def
_process_ping
(
self
,
_client
,
stanza
,
_
properties
):
self
.
_log
.
info
(
'Send pong to %s'
,
stanza
.
getFrom
())
iq
=
stanza
.
buildSimpleReply
(
'result'
)
self
.
_client
.
send_stanza
(
iq
)
...
...
nbxmpp/modules/security_labels.py
View file @
e80c9325
...
...
@@ -63,7 +63,7 @@ class SecurityLabels(BaseModule):
catalog_node
=
response
.
getTag
(
'catalog'
,
namespace
=
Namespace
.
SECLABEL_CATALOG
)
to
=
catalog_node
.
getAttr
(
'to'
)
items
=
catalog_node
.
getTags
(
'item'
)
labels
=
{}
...
...
nbxmpp/modules/user_avatar.py
View file @
e80c9325
...
...
@@ -226,7 +226,7 @@ def _get_avatar_data(item, id_):
avatar_sha
=
hashlib
.
sha1
(
avatar
).
hexdigest
()
if
avatar_sha
!=
id_
:
raise
MalformedStanzaError
(
f
'avatar does not match sha'
,
item
)
raise
MalformedStanzaError
(
'avatar does not match sha'
,
item
)
return
AvatarData
(
data
=
avatar
,
sha
=
avatar_sha
)
...
...
nbxmpp/modules/vcard4.py
View file @
e80c9325
...
...
@@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with this program; If not, see <http://www.gnu.org/licenses/>.
# pylint: disable=E1120
import
logging
from
typing
import
List
...
...
nbxmpp/old_dispatcher.py
View file @
e80c9325
...
...
@@ -290,7 +290,7 @@ class XMPPDispatcher(PlugIn):
self
.
_owner
.
send
(
"%s%s>"
%
(
XML_DECLARATION
,
str
(
self
.
_metastream
)[:
-
2
]))
def
_check_stream_start
(
self
,
ns
,
tag
,
attrs
):
def
_check_stream_start
(
self
,
ns
,
tag
,
_
attrs
):
if
ns
!=
Namespace
.
STREAMS
or
tag
!=
'stream'
:
raise
ValueError
(
'Incorrect stream start: '
'(%s,%s). Terminating.'
%
(
tag
,
ns
))
...
...
nbxmpp/structs.py
View file @
e80c9325
...
...
@@ -434,6 +434,8 @@ class DiscoInfo(NamedTuple):
except
Exception
:
continue
return
None
def
supports
(
self
,
feature
:
str
)
->
bool
:
return
feature
in
self
.
features
...
...
nbxmpp/task.py
View file @
e80c9325
...
...
@@ -322,6 +322,7 @@ class IqRequestTask(Task):
self
.
_iq_id
=
None
def
_run_async
(
self
,
stanza
:
Node
):
# pylint: disable=arguments-renamed
self
.
_iq_id
=
self
.
_client
.
send_stanza
(
stanza
,
callback
=
self
.
_async_finished
,
timeout
=
self
.
_timeout
)
...
...
@@ -358,6 +359,7 @@ class HTTPRequestTask(Task):
self
.
_session
=
session
def
_run_async
(
self
,
message
):
# pylint: disable=arguments-renamed
self
.
_session
.
queue_message
(
message
,
self
.
_async_finished
,
None
)
def
_async_finished
(
self
,
_session
,
message
,
_user_data
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment