Commit e23cbe36 authored by Emmanuel Gil Peyrot's avatar Emmanuel Gil Peyrot Committed by Philipp Hörist
Browse files

Fix typos

Thanks codespell!
parent c0785403
Pipeline #5617 passed with stages
in 2 minutes and 47 seconds
......@@ -233,7 +233,7 @@ def __init__(self, parent_win, contact, acct, session, resource=None):
])
if self._type.is_chat:
# Dont connect this when PrivateChatControl is used
# Dont connect this when PrivateChatControl is used
self.register_event('update-roster-avatar', ged.GUI1, self._on_update_roster_avatar)
# pylint: enable=line-too-long
......@@ -1251,7 +1251,7 @@ def restore_conversation(self):
def read_queue(self):
"""
Read queue and print messages containted in it
Read queue and print messages contained in it
"""
jid = self.contact.jid
jid_with_resource = jid
......
......@@ -855,11 +855,11 @@ def _on_message_textview_key_press_event(self, widget, event):
position = message_buffer.get_insert()
end = message_buffer.get_iter_at_mark(position)
text = message_buffer.get_text(start, end, False)
splitted = text.split()
split = text.split()
if (text.startswith(self.COMMAND_PREFIX) and
not text.startswith(self.COMMAND_PREFIX * 2) and
len(splitted) == 1):
text = splitted[0]
len(split) == 1):
text = split[0]
bare = text.lstrip(self.COMMAND_PREFIX)
if len(text) == 1:
self.command_hits = []
......@@ -1425,7 +1425,7 @@ def _on_scroll(self, widget, event):
direction = Gdk.ScrollDirection.RIGHT
else:
app.log('autoscroll').warning(
'Scroll directions cant be determined')
'Scroll directions cant be determined')
if direction != Gdk.ScrollDirection.UP:
return
......
......@@ -87,7 +87,7 @@
# {room_jid: password}
gc_passwords = {} # type: Dict[str, str]
# dict of rooms that must be automaticaly configured
# dict of rooms that must be automatically configured
# and for which we have a list of invities
# {account: {room_jid: {'invities': []}}}
automatic_rooms = {} # type: Dict[str, Dict[str, Dict[str, List[str]]]]
......
......@@ -124,7 +124,7 @@ def supports(self, requested_feature):
if self.show == 'offline':
# Unfortunately, if all resources are offline, the contact
# includes the last resource that was online. Check for its
# show, so we can be sure it's existant. Otherwise, we still
# show, so we can be sure it's existent. Otherwise, we still
# return caps for a contact that has no resources left.
return False
......@@ -159,7 +159,7 @@ def __init__(self, jid, account, name='', groups=None, show='', status='',
CommonContact.__init__(self, jid, account, resource, show,
None, status, name, chatstate)
self.contact_name = '' # nick choosen by contact
self.contact_name = '' # nick chosen by contact
self.groups = [i if i else _('General') for i in set(groups)] # filter duplicate values
self.avatar_sha = avatar_sha
self._is_groupchat = groupchat
......
......@@ -34,7 +34,7 @@ def __str__(self):
class DatabaseMalformed(Exception):
"""
The databas can't be read
The database can't be read
"""
def __init__(self, path=''):
......
......@@ -432,9 +432,9 @@ def datetime_tuple(timestamp):
Because of various datetime formats are used the following exceptions
are handled:
- Optional milliseconds appened to the string are removed
- Optional Z (that means UTC) appened to the string are removed
- XEP-082 datetime strings have all '-' cahrs removed to meet
- Optional milliseconds appended to the string are removed
- Optional Z (that means UTC) appended to the string are removed
- XEP-082 datetime strings have all '-' chars removed to meet
the above format.
"""
date, tim = timestamp.split('T', 1)
......@@ -1518,7 +1518,7 @@ def is_affiliation_change_allowed(self_contact, contact, target_aff):
return False
if target_aff in ('admin', 'owner'):
# Admin cant edit admin/owner list
# Admin cant edit admin/owner list
return False
return self_contact.affiliation > contact.affiliation
......
......@@ -38,7 +38,7 @@ def get_locale_dirs():
path = gettext.find(DOMAIN)
if path is not None:
# gettext can find the location itself
# so we dont need the localedir
# so we dont need the localedir
return
if Path('/app/share/run-as-flatpak').exists():
......
......@@ -51,8 +51,8 @@ class State(IntEnum):
# This also includes any candidate-error received or sent
CAND_SENT_AND_RECEIVED = 4
TRANSPORT_REPLACE = 5
# We are transfering the file
TRANSFERING = 6
# We are transferring the file
TRANSFERRING = 6
class JingleFileTransfer(JingleContent):
......@@ -114,7 +114,7 @@ def __init__(self, session, transport=None, file_props=None,
State.INITIALIZED : StateInitialized(self),
State.CAND_SENT : StateCandSent(self),
State.CAND_RECEIVED : StateCandReceived(self),
State.TRANSFERING : StateTransfering(self),
State.TRANSFERRING : StateTransfering(self),
State.TRANSPORT_REPLACE : StateTransportReplace(self),
State.CAND_SENT_AND_RECEIVED : StateCandSentAndRecv(self)
}
......@@ -167,7 +167,7 @@ def __send_hash(self):
self.session.connection.get_module('Jingle').set_file_info(file_info)
def _compute_hash(self):
# Caculates the hash and returns a xep-300 hash stanza
# Calculates the hash and returns a xep-300 hash stanza
if self.file_props.algo is None:
return
try:
......@@ -181,7 +181,7 @@ def _compute_hash(self):
# DEBUG
#hash_ = '1294809248109223'
if not hash_:
# Hash alogrithm not supported
# Hash algorithm not supported
return
self.file_props.hash_ = hash_
h.addHash(hash_, self.file_props.algo)
......@@ -218,7 +218,7 @@ def continue_session_accept(self, stanza):
if self.session.werequest:
raise nbxmpp.NodeProcessed
# We send the file
self.__state_changed(State.TRANSFERING)
self.__state_changed(State.TRANSFERRING)
raise nbxmpp.NodeProcessed
self.file_props.streamhosts = self.transport.remote_candidates
# Calculate file hash in a new thread
......@@ -243,7 +243,7 @@ def continue_session_accept(self, stanza):
fingerprint=fingerprint,
receiving=False)
raise nbxmpp.NodeProcessed
self.__state_changed(State.TRANSFERING)
self.__state_changed(State.TRANSFERRING)
raise nbxmpp.NodeProcessed
def __on_session_terminate(self, stanza, content, error, action):
......@@ -282,7 +282,7 @@ def __on_transport_info(self, stanza, content, error, action):
response = stanza.buildReply('result')
response.delChild(response.getQuery())
self.session.connection.connection.send(response)
self.__state_changed(State.TRANSFERING)
self.__state_changed(State.TRANSFERRING)
raise nbxmpp.NodeProcessed
else:
args = {'candError' : True}
......@@ -300,7 +300,7 @@ def __on_transport_info(self, stanza, content, error, action):
not app.socks5queue.listener.connections:
app.socks5queue.listener.disconnect()
if content.getTag('transport').getTag('activated'):
self.state = State.TRANSFERING
self.state = State.TRANSFERRING
app.socks5queue.send_file(self.file_props,
self.session.connection.name, 'client')
return
......@@ -308,7 +308,7 @@ def __on_transport_info(self, stanza, content, error, action):
'sendCand': False}
if self.state == State.CAND_SENT:
self.__state_changed(State.CAND_SENT_AND_RECEIVED, args)
self.__state_changed(State.TRANSFERING)
self.__state_changed(State.TRANSFERRING)
raise nbxmpp.NodeProcessed
self.__state_changed(State.CAND_RECEIVED, args)
......@@ -325,14 +325,14 @@ def __on_iq_result(self, stanza, content, error, action):
self.__state_changed(State.TRANSPORT_REPLACE)
return
# initiate transfer
self.__state_changed(State.TRANSFERING)
self.__state_changed(State.TRANSFERRING)
def __transport_setup(self, stanza=None, content=None, error=None,
action=None):
# Sets up a few transport specific things for the file transfer
if self.transport.type_ == TransportType.IBB:
# No action required, just set the state to transfering
self.state = State.TRANSFERING
# No action required, just set the state to transferring
self.state = State.TRANSFERRING
else:
self._listen_host()
......@@ -401,7 +401,7 @@ def is_our_candidate_used(self):
def start_ibb_transfer(self):
if self.file_props.type_ == 's':
self.__state_changed(State.TRANSFERING)
self.__state_changed(State.TRANSFERRING)
def get_content(desc):
......
......@@ -35,7 +35,7 @@ def __init__(self, jingleft):
def action(self, args=None):
'''
This method MUST be overriden by a subclass
This method MUST be overridden by a subclass
'''
raise NotImplementedError('This is an abstract method!')
......@@ -107,7 +107,7 @@ def _recv_candidate(self, args):
streamhost_used = cand
break
if streamhost_used is None:
log.info("unknow streamhost")
log.info("unknown streamhost")
return
# We save the candidate nominated by peer
self.jft.nominated_cand['peer-cand'] = streamhost_used
......@@ -141,7 +141,7 @@ def action(self, args=None):
class StateTransfering(JingleFileTransferStates):
'''
This state will start the transfer depeding on the type of transport
This state will start the transfer depending on the type of transport
we have.
'''
......@@ -153,7 +153,7 @@ def _start_ibb_transfer(self, con):
fp)
def _start_sock5_transfer(self):
# It tells wether we start the transfer as client or server
# It tells whether we start the transfer as client or server
mode = None
if self.jft.is_our_candidate_used():
mode = 'client'
......
......@@ -134,8 +134,8 @@ def make_bin_from_config(self, config_key, pipeline, text):
def add_remote_candidates(self, candidates):
JingleContent.add_remote_candidates(self, candidates)
# FIXME: connectivity should not be etablished yet
# Instead, it should be etablished after session-accept!
# FIXME: connectivity should not be established yet
# Instead, it should be established after session-accept!
if self.sent:
self.p2pstream.add_remote_candidates(candidates)
......@@ -347,13 +347,13 @@ def __init__(self, session, transport=None):
def set_mic_volume(self, vol):
"""
vol must be between 0 ans 1
vol must be between 0 and 1
"""
self.mic_volume.set_property('volume', vol)
def set_out_volume(self, vol):
"""
vol must be between 0 ans 1
vol must be between 0 and 1
"""
self.out_volume.set_property('volume', vol)
......
......@@ -562,7 +562,7 @@ def __on_session_initiate(self, stanza, jingle, error, action):
pjid, hash_data, n, self.connection.name)
if not file_info:
log.warning('The peer %s is requesting a ' \
'file that we dont have or ' \
'file that we dont have or ' \
'it is not allowed to request', pjid)
self.decline_session()
raise nbxmpp.NodeProcessed
......
......@@ -242,7 +242,7 @@ def createCertificate(req, issuerCert, issuerKey, serial, notBefore, notAfter, d
"""
Generate a certificate given a certificate request.
Arguments: req - Certificate reqeust to use
Arguments: req - Certificate request to use
issuerCert - The certificate of the issuer
issuerKey - The private key of the issuer
serial - Serial number for the certificate
......
......@@ -354,7 +354,7 @@ def _migrate_cache(self, con):
@staticmethod
def _execute_multiple(con, statements):
"""
Execute mutliple statements with the option to fail on duplicates
Execute multiple statements with the option to fail on duplicates
but still continue
"""
for sql in statements:
......@@ -480,7 +480,7 @@ def jid_is_from_pm(self, jid):
If jid is gajim@conf/nkour it's likely a pm one, how we know gajim@conf
is not a normal guy and nkour is not his resource? we ask if gajim@conf
is already in jids (with type room jid) this fails if user disables
logging for room and only enables for pm (so higly unlikely) and if we
logging for room and only enables for pm (so highly unlikely) and if we
fail we do not go chaos (user will see the first pm as if it was message
in room's public chat) and after that all okay
"""
......@@ -750,7 +750,7 @@ def get_last_conversation_lines(self, account, jid, pending):
Get recent messages
Pending messages are already in queue to be printed when the
ChatControl is opened, so we dont want to request those messages.
ChatControl is opened, so we dont want to request those messages.
How many messages are requested depends on the 'restore_lines'
config value. How far back in time messages are requested depends on
_get_timeout().
......@@ -759,7 +759,7 @@ def get_last_conversation_lines(self, account, jid, pending):
:param jid: The jid from which we request the conversation lines
:param pending: How many messages are currently pending so we dont
:param pending: How many messages are currently pending so we dont
request those messages
returns a list of namedtuples
......@@ -849,7 +849,7 @@ def search_log(self, account, jid, query, date=None):
Search the conversation log for messages containing the `query` string.
The search can either span the complete log for the given
`account` and `jid` or be restriced to a single day by
`account` and `jid` or be restricted to a single day by
specifying `date`.
:param account: The account
......@@ -1192,7 +1192,7 @@ def get_roster(self, account_jid):
data = {}
account_jid_id = self.get_jid_id(account_jid, type_=JIDConstant.NORMAL_TYPE)
# First we fill data with roster_entry informations
# First we fill data with roster_entry information
rows = self._con.execute('''
SELECT j.jid, re.jid_id, re.name, re.subscription, re.ask, re.avatar_sha
FROM roster_entry re, jids j
......
......@@ -22,7 +22,7 @@
def parseLogLevel(arg):
"""
Eiter numeric value or level name from logging module
Either numeric value or level name from logging module
"""
if arg.isdigit():
return int(arg)
......
......@@ -40,7 +40,7 @@ class AdHocCommand:
@staticmethod
def is_visible_for(_samejid):
"""
This returns True if that command should be visible and invokable for
This returns True if that command should be visible and invocable for
others
samejid - True when command is invoked by an entity with the same bare
......
......@@ -58,7 +58,7 @@ def __getattr__(self, key):
key, self.__class__.__name__))
if not app.account_is_connected(self._account):
self._log.warning('Account not connected, cant use %s', key)
self._log.warning('Account not connected, cant use %s', key)
return None
module = self._con.connection.get_module(self._nbxmpp_extends)
......@@ -70,7 +70,7 @@ def __getattr__(self, key):
def _nbxmpp(self, module_name=None):
if not app.account_is_connected(self._account):
self._log.warning('Account not connected, cant use nbxmpp method')
self._log.warning('Account not connected, cant use nbxmpp method')
return Mock()
if module_name is None:
......
......@@ -79,7 +79,7 @@ def recurs(node, cid, data):
del self.awaiting_cids[cid]
return
# An error occured, call callback without modifying data.
# An error occurred, call callback without modifying data.
for func in self.awaiting_cids[cid]:
cb = func[0]
args = func[1]
......
......@@ -74,8 +74,8 @@ def _blocking_list_received(self, result):
def _blocking_push_received(self, _con, stanza, _properties):
reply = stanza.buildReply('result')
childs = reply.getChildren()
for child in childs:
children = reply.getChildren()
for child in children:
reply.delChild(child)
self._nbxmpp().send(reply)
......
......@@ -133,7 +133,7 @@ def send_file_approval(self, file_props):
"""
Send iq, confirming that we want to download the file
"""
# user response to ConfirmationDialog may come after we've disconneted
# user response to ConfirmationDialog may come after we've disconnected
if not app.account_is_available(self._account):
return
......
......@@ -223,7 +223,7 @@ def get_active_chatstate(self, contact: ContactT) -> Optional[str]:
return None
if not contact.is_groupchat:
# Dont send chatstates to ourself
# Dont send chatstates to ourself
if self._con.get_own_jid().bareMatch(contact.jid):
return None
......@@ -255,7 +255,7 @@ def set_chatstate_delayed(self, contact: ContactT, state: State) -> None:
@ensure_enabled
def set_chatstate(self, contact: ContactT, state: State) -> None:
# Dont send chatstates to ourself
# Dont send chatstates to ourself
if self._con.get_own_jid().bareMatch(contact.jid):
return
......@@ -280,7 +280,7 @@ def set_chatstate(self, contact: ContactT, state: State) -> None:
return
if not contact.is_groupchat:
# Dont leak presence to contacts
# Dont leak presence to contacts
# which are not allowed to see our status
if not contact.is_pm_contact:
if contact and contact.sub in ('to', 'none'):
......
Markdown is supported
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