Commit e80c9325 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

ci: Fix Pylint errors

parent a55e844c
Pipeline #9621 passed with stages
in 47 seconds
......@@ -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
......
......@@ -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):
......
......@@ -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
......
......@@ -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,
......
......@@ -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
......
......@@ -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)
......
......@@ -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():
......
......@@ -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')
......
......@@ -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)
......
......@@ -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 = {}
......
......@@ -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)
......
......@@ -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
......
......@@ -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))
......
......@@ -434,6 +434,8 @@ class DiscoInfo(NamedTuple):
except Exception:
continue
return None
def supports(self, feature: str) -> bool:
return feature in self.features
......
......@@ -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):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment