Philipp Hörist pushed to branch master at gajim / gajim
Commits:
78ebaefa by Philipp Hörist at 2018-06-23T20:15:00+02:00
Dont punycode encode all domain names
RFC7622 3.2.1
... This implies that the string MUST NOT include A-labels ...
Fixes #9211
- - - - -
1 changed file:
- gajim/common/helpers.py
Changes:
=====================================
gajim/common/helpers.py
=====================================
--- a/gajim/common/helpers.py
+++ b/gajim/common/helpers.py
@@ -61,12 +61,6 @@ try:
except ImportError:
HAS_PRECIS_I18N = False
-try:
- import idna
- HAS_IDNA = True
-except ImportError:
- HAS_IDNA = False
-
HAS_SOUND = True
if sys.platform == 'win32':
try:
@@ -291,16 +285,13 @@ def prep(user, server, resource):
if not ip_address:
if server is not None:
- if server.endswith('.'): # RFC7622, 3.2
+ if server.endswith('.'): # RFC7622, 3.2
server = server[:-1]
if len(server) < 1 or len(server.encode('utf-8')) > 1023:
raise InvalidFormat(_('Server must be between 1 and 1023 bytes'))
try:
- if HAS_IDNA:
- server = idna.encode(server).decode('utf-8')
- else:
- from nbxmpp.stringprepare import nameprep
- server = nameprep.prepare(server)
+ from nbxmpp.stringprepare import nameprep
+ server = nameprep.prepare(server)
except UnicodeError:
raise InvalidFormat(_('Invalid character in hostname.'))
else:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/78ebaefaec66e987cf43c6af936530ad25…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/78ebaefaec66e987cf43c6af936530ad25…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
af11aa98 by Philipp Hörist at 2018-06-22T20:23:35+02:00
Make sure show is always a string
This is so we hopefully can find some bugs
- - - - -
2 changed files:
- gajim/common/contacts.py
- gajim/common/helpers.py
Changes:
=====================================
gajim/common/contacts.py
=====================================
--- a/gajim/common/contacts.py
+++ b/gajim/common/contacts.py
@@ -65,6 +65,16 @@ class CommonContact(XMPPEntity):
# this is contact's chatstate
self.chatstate = chatstate
+ @property
+ def show(self):
+ return self._show
+
+ @show.setter
+ def show(self, value):
+ if not isinstance(value, str):
+ raise TypeError('show must be a string')
+ self._show = value
+
def get_full_jid(self):
raise NotImplementedError
=====================================
gajim/common/helpers.py
=====================================
--- a/gajim/common/helpers.py
+++ b/gajim/common/helpers.py
@@ -420,7 +420,7 @@ def get_css_show_color(show):
return None
elif show in ('xa', 'dnd'):
return 'status-dnd'
- elif show in ('away'):
+ elif show == 'away':
return 'status-away'
def get_uf_sub(sub):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/af11aa985b07d67953fd0a7039663960cb…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/af11aa985b07d67953fd0a7039663960cb…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
672f02b3 by Alexander Krotov at 2018-06-22T08:05:31+02:00
Fix usage of loop variable in socks5.py
Loop seems to be checking whether on_success callback
is already called, but due to wrong variable used
it did nothing.
- - - - -
1 changed file:
- gajim/common/socks5.py
Changes:
=====================================
gajim/common/socks5.py
=====================================
--- a/gajim/common/socks5.py
+++ b/gajim/common/socks5.py
@@ -106,8 +106,9 @@ class SocksQueue:
return 1
return 0
for host in file_props.streamhosts:
- if streamhost['state'] == 1:
- return 0
+ if host['state'] == 1:
+ # on_success callback already called for another host
+ return 0 # return 0 to disconnect this one
streamhost['state'] = 1
self.on_success[file_props.transport_sid](streamhost)
return 1
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/672f02b3b0abf1e8851452a632a6d2b50a…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/672f02b3b0abf1e8851452a632a6d2b50a…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
d871dcdc by Alexander Krotov at 2018-06-22T01:47:29+03:00
More spelling fixes
- - - - -
20 changed files:
- README.md
- data/gajim-remote.1
- gajim/chat_control_base.py
- gajim/command_system/errors.py
- gajim/command_system/framework.py
- gajim/command_system/implementation/__init__.py
- gajim/command_system/implementation/custom.py
- gajim/command_system/implementation/middleware.py
- gajim/command_system/implementation/standard.py
- gajim/command_system/mapping.py
- gajim/common/app.py
- gajim/common/jingle_session.py
- gajim/common/protocol/bytestream.py
- gajim/common/proxy65_manager.py
- gajim/groupchat_control.py
- gajim/gui_interface.py
- gajim/roster_window.py
- gajim/tooltips.py
- scripts/dev/plugins_translate
- test/unit/test_jingle.py
Changes:
=====================================
README.md
=====================================
--- a/README.md
+++ b/README.md
@@ -58,9 +58,9 @@ see [Wiki](https://dev.gajim.org/gajim/gajim/wikis/help/gajimmacosx#python3brew)
#### Developing
-For developing you dont have to install Gajim.
+For developing you don't have to install Gajim.
-After installing all dependencys execute
+After installing all dependencies execute
``./launch.py``
=====================================
data/gajim-remote.1
=====================================
--- a/data/gajim-remote.1
+++ b/data/gajim-remote.1
@@ -70,7 +70,7 @@ Shows or hides the roster window
.Sh EXAMPLES
Open a URI of group chat gajim
.Pp
-.Dl $ gajim-remote handle_uri xmpp:gajim@conferenc.gajim.org?join
+.Dl $ gajim-remote handle_uri xmpp:gajim@conference.gajim.org?join
.Pp
Send custom XML
.Pp
=====================================
gajim/chat_control_base.py
=====================================
--- a/gajim/chat_control_base.py
+++ b/gajim/chat_control_base.py
@@ -387,7 +387,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
app.ged.register_event_handler('ping-error', ged.GUI1,
self._nec_ping_error)
- # This is bascially a very nasty hack to surpass the inability
+ # This is basically a very nasty hack to surpass the inability
# to properly use the super, because of the old code.
CommandTools.__init__(self)
@@ -531,7 +531,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
def on_banner_label_populate_popup(self, label, menu):
"""
- Override the default context menu and add our own menutiems
+ Override the default context menu and add our own menuitems
"""
item = Gtk.SeparatorMenuItem.new()
menu.prepend(item)
@@ -617,9 +617,9 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
elif (self.space_pressed or self.msg_textview.undo_pressed) and \
event.keyval not in (Gdk.KEY_Control_L, Gdk.KEY_Control_R) and \
not (event.keyval == Gdk.KEY_z and event.get_state() & Gdk.ModifierType.CONTROL_MASK):
- # If the space key has been pressed and now it hasnt,
- # we save the buffer into the undo list. But be carefull we're not
- # pressiong Control again (as in ctrl+z)
+ # If the space key has been pressed and now it hasn't,
+ # we save the buffer into the undo list. But be careful we're not
+ # pressing Control again (as in ctrl+z)
_buffer = widget.get_buffer()
start_iter, end_iter = _buffer.get_bounds()
self.msg_textview.save_undo(_buffer.get_text(start_iter, end_iter, True))
@@ -938,7 +938,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
pos = self.received_history_pos
size = len(history)
scroll = False if pos == size else True # are we scrolling?
- # we don't want size of the buffer to grow indefinately
+ # we don't want size of the buffer to grow indefinitely
max_size = app.config.get('key_up_lines')
for i in range(size - max_size + 1):
if pos == 0:
@@ -1180,7 +1180,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
def on_minimize_menuitem_toggled(self, widget):
"""
- When a grouchat is minimized, unparent the tab, put it in roster etc
+ When a groupchat is minimized, unparent the tab, put it in roster etc
"""
old_value = True
non_minimized_gc = app.config.get_per('accounts', self.account,
@@ -1286,7 +1286,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
if event != Gdk.KEY_Page_Up:
return
else:
- # On scrolliung UP disable autoscroll
+ # On scrolling UP disable autoscroll
# get_scroll_direction() sets has_direction only TRUE
# if smooth scrolling is deactivated. If we have smooth
# smooth scrolling we have to use get_scroll_deltas()
@@ -1437,7 +1437,7 @@ class ScrolledWindow(Gtk.ScrolledWindow):
# Gtk Bug: If policy is set to Automatic, the ScrolledWindow
# has a min size of around 46-82 depending on the System. Because
# we want it smaller, we set policy NEVER if the height is < 90
- # so the ScrolledWindow will shrink to around 26 (1 line heigh).
+ # so the ScrolledWindow will shrink to around 26 (1 line height).
# Once it gets over 90 its no problem to restore the policy.
if natural_height < 90:
GLib.idle_add(self.set_policy,
=====================================
gajim/command_system/errors.py
=====================================
--- a/gajim/command_system/errors.py
+++ b/gajim/command_system/errors.py
@@ -36,13 +36,13 @@ class BaseError(Exception):
class DefinitionError(BaseError):
"""
- Used to indicate errors occured on command definition.
+ Used to indicate errors occurred on command definition.
"""
pass
class CommandError(BaseError):
"""
- Used to indicate errors occured during command execution.
+ Used to indicate errors occurred during command execution.
"""
pass
=====================================
gajim/command_system/framework.py
=====================================
--- a/gajim/command_system/framework.py
+++ b/gajim/command_system/framework.py
@@ -42,7 +42,7 @@ class CommandHost(metaclass=Host):
class CommandContainer(metaclass=Container):
"""
Command container is an entity which holds defined commands,
- allowing them to be dispatched and proccessed correctly. Each
+ allowing them to be dispatched and processed correctly. Each
command container may be bound to a one or more command hosts.
The AUTOMATIC class variable, which must be defined by a command
@@ -159,7 +159,7 @@ class Command(object):
try:
return self.handler(*args, **kwargs)
- # This allows to use a shortcuted way of raising an exception
+ # This allows to use a shortcut way of raising an exception
# inside a handler. That is to raise a CommandError without
# command or name attributes set. They will be set to a
# corresponding values right here in case if they was not set by
@@ -235,7 +235,7 @@ def command(*names, **properties):
facilities for setting command's names and properties.
Names should contain a set of names (aliases) by which the command
- can be reached. If no names are given - the the native name (the one
+ can be reached. If no names are given - the native name (the one
extracted from the command handler) will be used.
If native=True is given (default) and names is non-empty - then the
=====================================
gajim/command_system/implementation/__init__.py
=====================================
--- a/gajim/command_system/implementation/__init__.py
+++ b/gajim/command_system/implementation/__init__.py
@@ -14,7 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
-The implementation and auxilary systems which implement the standard
+The implementation and auxiliary systems which implement the standard
Gajim commands and also provide an infrastructure for adding custom
commands.
"""
=====================================
gajim/command_system/implementation/custom.py
=====================================
--- a/gajim/command_system/implementation/custom.py
+++ b/gajim/command_system/implementation/custom.py
@@ -27,7 +27,7 @@
"""
This module contains examples of how to create your own commands, by
creating a new command container, bounded to a specific command host,
-and definding a set of commands inside of it.
+and defining a set of commands inside of it.
Keep in mind that this module is not being loaded from anywhere, so the
code in here will not be executed and commands defined here will not be
@@ -59,7 +59,7 @@ class CustomCommonCommands(CommandContainer):
programmatically extracted and formatted.
After that you can give more help, like explanation of the
- options. This one will be programatically extracted and
+ options. This one will be programmatically extracted and
formatted too.
After all the documentation - there will be autogenerated (based
=====================================
gajim/command_system/implementation/middleware.py
=====================================
--- a/gajim/command_system/implementation/middleware.py
+++ b/gajim/command_system/implementation/middleware.py
@@ -86,7 +86,7 @@ class ChatCommandProcessor(CommandProcessor):
def command_preprocessor(self, command, name, arguments, args, kwargs):
# If command argument contain h or help option - forward it to
- # the /help command. Dont forget to pass self, as all commands
+ # the /help command. Don't forget to pass self, as all commands
# are unbound. And also don't forget to print output.
if 'h' in kwargs or 'help' in kwargs:
help = self.get_command('help')
=====================================
gajim/command_system/implementation/standard.py
=====================================
--- a/gajim/command_system/implementation/standard.py
+++ b/gajim/command_system/implementation/standard.py
@@ -161,7 +161,7 @@ class StandardCommonCommands(CommandContainer):
class StandardCommonChatCommands(CommandContainer):
"""
- This command container contans standard commands, which are common
+ This command container contains standard commands, which are common
to a chat and a private chat only.
"""
=====================================
gajim/command_system/mapping.py
=====================================
--- a/gajim/command_system/mapping.py
+++ b/gajim/command_system/mapping.py
@@ -15,7 +15,7 @@
"""
The module contains routines to parse command arguments and map them to
-the command handler's positonal and keyword arguments.
+the command handler's positional and keyword arguments.
Mapping is done in two stages: 1) parse arguments into positional
arguments and options; 2) adapt them to the specific command handler
@@ -33,7 +33,7 @@ ARG_PATTERN = re.compile(r'(\'|")?(?P<body>(?(1).+?|\S+))(?(1)\1)')
OPT_PATTERN = re.compile(r'(?<!\w)--?(?P<key>[\w-]+)(?:(?:=|\s)(\'|")?(?P<value>(?(2)[^-]+?|[^-\s]+))(?(2)\2))?')
# Option keys needs to be encoded to a specific encoding as Python does
-# not allow to expand dictionary with raw unicode strings as keys from a
+# not allow to expand dictionary with raw Unicode strings as keys from a
# **kwargs.
KEY_ENCODING = 'UTF-8'
@@ -140,7 +140,7 @@ def adapt_arguments(command, arguments, args, opts):
arguments_end = len(arguments) - 1
# If there are any optional arguments given they should be
- # either an unquoted postional argument or part of the raw
+ # either an unquoted positional argument or part of the raw
# argument. So we find all optional arguments that can
# possibly be unquoted argument and append them as is to the
# args.
@@ -164,7 +164,7 @@ def adapt_arguments(command, arguments, args, opts):
raise CommandError(_("Missing arguments"), command)
# The essential point of the whole play. After
- # boundaries are being determined (supposingly correct)
+ # boundaries are being determined (supposedly correct)
# we separate raw part from the rest of arguments, which
# should be normally processed.
raw = arguments[end:]
@@ -181,7 +181,7 @@ def adapt_arguments(command, arguments, args, opts):
args.append((raw, (end, arguments_end)))
else:
- # Substitue all of the arguments with only one, which
+ # Substitute all of the arguments with only one, which
# contain raw and unprocessed arguments as a string. And
# discard all the options, as raw command does not
# support them.
@@ -201,9 +201,9 @@ def adapt_arguments(command, arguments, args, opts):
if '-' in key:
opts[index] = (key.replace('-', '_'), value, position)
- # The second stage of transforming options to an associatable state.
+ # The second stage of transforming options to an associable state.
# Expanding short, one-letter options to a verbose ones, if
- # corresponding optin has been given.
+ # corresponding opt-in has been given.
if command.expand:
expanded = []
for spec_key, spec_value in norm_kwargs.items():
@@ -248,7 +248,7 @@ def adapt_arguments(command, arguments, args, opts):
# Detect if positional arguments overlap keyword arguments. If so
# and this is allowed by command options - then map them directly to
- # their options, so they can get propert further processings.
+ # their options, so they can get proper further processing.
spec_fix = 1 if command.source else 0
spec_len = len(spec_args) - spec_fix
if len(args) > spec_len:
@@ -281,11 +281,11 @@ def generate_usage(command, complete=True):
"""
Extract handler's arguments specification and wrap them in a
human-readable format usage information. If complete is given - then
- USAGE_PATTERN will be used to render the specification completly.
+ USAGE_PATTERN will be used to render the specification completely.
"""
spec_args, spec_kwargs, var_args, var_kwargs = command.extract_specification()
- # Remove some special positional arguments from the specifiaction,
+ # Remove some special positional arguments from the specification,
# but store their names so they can be used for usage info
# generation.
sp_source = spec_args.pop(0) if command.source else None
=====================================
gajim/common/app.py
=====================================
--- a/gajim/common/app.py
+++ b/gajim/common/app.py
@@ -70,7 +70,7 @@ os_info = None # used to cache os information
transport_type = {} # list the type of transport
-last_message_time = {} # list of time of the latest incomming message
+last_message_time = {} # list of time of the latest incoming message
# {acct1: {jid1: time1, jid2: time2}, }
encrypted_chats = {} # list of encrypted chats {acct1: [jid1, jid2], ..}
=====================================
gajim/common/jingle_session.py
=====================================
--- a/gajim/common/jingle_session.py
+++ b/gajim/common/jingle_session.py
@@ -423,7 +423,7 @@ class JingleSession:
self.connection.connection.send(stanza)
raise nbxmpp.NodeProcessed
else:
- # FIXME: This ressource is unknown to us, what should we do?
+ # FIXME: This resource is unknown to us, what should we do?
# For now, reject the transport
stanza, jingle = self.__make_jingle('transport-reject')
content = jingle.setTag('content', attrs={'creator': creator,
@@ -533,7 +533,7 @@ class JingleSession:
self._session_terminate(reason)
raise nbxmpp.NodeProcessed
- # If we are not receivin a file
+ # If we are not receiving a file
# Check if there's already a session with this user:
if contents[0].media != 'file':
for session in self.connection.iter_jingle_sessions(self.peerjid):
=====================================
gajim/common/protocol/bytestream.py
=====================================
--- a/gajim/common/protocol/bytestream.py
+++ b/gajim/common/protocol/bytestream.py
@@ -191,10 +191,10 @@ class ConnectionBytestream:
"""
Inform sender that we refuse to download the file
- typ is used when code = '400', in this case typ can be 'strean' for
+ typ is used when code = '400', in this case typ can be 'stream' for
invalid stream or 'profile' for invalid profile
"""
- # user response to ConfirmationDialog may come after we've disconneted
+ # user response to ConfirmationDialog may come after we've disconnected
if not self.connection or self.connected < 2:
return
if file_props.session_type == 'jingle':
@@ -376,7 +376,7 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
self._add_local_ips_as_streamhosts_to_query(query, file_props)
self._add_proxy_streamhosts_to_query(query, file_props)
self._add_upnp_igd_as_streamhost_to_query(query, file_props, iq)
- # Upnp-igd is ascynchronous, so it will send the iq itself
+ # Upnp-igd is asynchronous, so it will send the iq itself
def _add_streamhosts_to_query(self, query, sender, port, hosts):
for host in hosts:
@@ -855,7 +855,7 @@ class ConnectionIBBytestream(ConnectionBytestream):
def OpenStream(self, sid, to, fp, blocksize=4096):
"""
- Start new stream. You should provide stream id 'sid', the endpoind jid
+ Start new stream. You should provide stream id 'sid', the endpoint jid
'to', the file object containing info for send 'fp'. Also the desired
blocksize can be specified.
Take into account that recommended stanza size is 4k and IBB uses
@@ -942,7 +942,7 @@ class ConnectionIBBytestream(ConnectionBytestream):
elif seq != file_props.seq:
err = nbxmpp.ERR_UNEXPECTED_REQUEST
else:
- log.debug('Successfull receive sid->%s %s+%s bytes' % (sid,
+ log.debug('Successfully received sid->%s %s+%s bytes' % (sid,
file_props.fp.tell(), len(data)))
file_props.seq += 1
file_props.started = True
@@ -965,7 +965,7 @@ class ConnectionIBBytestream(ConnectionBytestream):
def StreamCloseHandler(self, conn, stanza):
"""
Handle stream closure due to all data transmitted.
- Raise xmpppy event specifying successfull data receive.
+ Raise xmpppy event specifying successful data receive.
"""
sid = stanza.getTagAttr('close', 'sid')
log.debug('StreamCloseHandler called sid->%s' % sid)
@@ -989,7 +989,7 @@ class ConnectionIBBytestream(ConnectionBytestream):
"""
Handle remote side reply about if it agree or not to receive our
datastream.
- Used internally. Raises xmpppy event specfiying if the data transfer
+ Used internally. Raises xmpppy event specifying if the data transfer
is agreed upon.
"""
syn_id = stanza.getID()
=====================================
gajim/common/proxy65_manager.py
=====================================
--- a/gajim/common/proxy65_manager.py
+++ b/gajim/common/proxy65_manager.py
@@ -45,7 +45,7 @@ class Proxy65Manager:
"""
Keep records for file transfer proxies. Each time account establishes a
connection to its server call proxy65manger.resolve(proxy) for every proxy
- that is convigured within the account. The class takes care to resolve and
+ that is configured within the account. The class takes care to resolve and
test each proxy only once
"""
@@ -65,7 +65,7 @@ class Proxy65Manager:
if proxy in self.proxies:
resolver = self.proxies[proxy]
else:
- # proxy is being ressolved for the first time
+ # proxy is being resolved for the first time
resolver = ProxyResolver(proxy, sender_jid, testit)
self.proxies[proxy] = resolver
resolver.add_connection(connection)
=====================================
gajim/groupchat_control.py
=====================================
--- a/gajim/groupchat_control.py
+++ b/gajim/groupchat_control.py
@@ -1770,7 +1770,7 @@ class GroupchatControl(ChatControlBase):
right_changed = False
if obj.real_jid:
- # delete ressource
+ # delete resource
simple_jid = app.get_jid_without_resource(obj.real_jid)
nick_jid += ' (%s)' % simple_jid
@@ -2209,7 +2209,7 @@ class GroupchatControl(ChatControlBase):
if contact.our_chatstate == state:
return
- # if wel're inactive prevent composing (XEP violation)
+ # if we're inactive prevent composing (XEP violation)
if contact.our_chatstate == 'inactive' and state == 'composing':
# go active before
app.nec.push_outgoing_event(GcMessageOutgoingEvent(None,
@@ -2296,7 +2296,7 @@ class GroupchatControl(ChatControlBase):
return True
includes = app.config.get('confirm_close_muc_rooms').split(' ')
excludes = app.config.get('noconfirm_close_muc_rooms').split(' ')
- # whether to ask for comfirmation before closing muc
+ # whether to ask for confirmation before closing muc
if (app.config.get('confirm_close_muc') or self.room_jid in includes)\
and app.gc_connected[self.account][self.room_jid] and self.room_jid \
not in excludes:
=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -1820,8 +1820,8 @@ class Interface:
# [^\s*] anything but whitespaces and '*'
# (?<!\S) is a one char lookbehind assertion and asks for any leading
# whitespace
- # and mathces beginning of lines so we have correct formatting detection
- # even if the the text is just '*foo*'
+ # and matches beginning of lines so we have correct formatting detection
+ # even if the text is just '*foo*'
# (?!\S) is the same thing but it's a lookahead assertion
# \S*[^\s\W] --> in the matching string don't match ? or ) etc.. if at
# the end
@@ -1869,7 +1869,7 @@ class Interface:
emoticons_pattern_postmatch = ''
emoticon_length = 0
for emoticon in keys: # travel thru emoticons list
- emoticon_escaped = re.escape(emoticon) # espace regexp metachars
+ emoticon_escaped = re.escape(emoticon) # escape regexp metachars
# | means or in regexp
emoticons_pattern += emoticon_escaped + '|'
if (emoticon_length != len(emoticon)):
@@ -2294,7 +2294,7 @@ class Interface:
def process_connections(self):
"""
- Called each foo (200) miliseconds. Check for idlequeue timeouts
+ Called each foo (200) milliseconds. Check for idlequeue timeouts
"""
try:
app.idlequeue.process()
@@ -2305,7 +2305,7 @@ class Interface:
# On Windows process() calls select.select(), so we need this
# executed as often as possible.
# Adding it directly with GLib.idle_add() causes Gajim to use
- # too much CPU time. Thats why its added with 1ms timeout.
+ # too much CPU time. That's why its added with 1ms timeout.
# On Linux only alarms are checked in process(), so we use
# a bigger timeout
timeout, in_seconds = 1, None
=====================================
gajim/roster_window.py
=====================================
--- a/gajim/roster_window.py
+++ b/gajim/roster_window.py
@@ -1113,7 +1113,7 @@ class RosterWindow:
def _really_draw_group(self, group, account):
child_iter = self._get_group_iter(group, account, model=self.model)
if not child_iter:
- # Eg. We redraw groups after we removed a entitiy
+ # Eg. We redraw groups after we removed a entity
# and its empty groups
return
if self.regroup:
=====================================
gajim/tooltips.py
=====================================
--- a/gajim/tooltips.py
+++ b/gajim/tooltips.py
@@ -502,7 +502,7 @@ class RosterTooltip(Gtk.Window, StatusTable):
self.jid.show()
self.jid_label.show()
- # contact has only one ressource
+ # contact has only one resource
if self.num_resources == 1 and contact.resource:
res = GLib.markup_escape_text(contact.resource)
prio = str(contact.priority)
@@ -615,7 +615,7 @@ class RosterTooltip(Gtk.Window, StatusTable):
def _get_icon_name_for_tooltip(self, contact):
"""
- Helper function used for tooltip contacts/acounts
+ Helper function used for tooltip contacts/accounts
Tooltip on account has fake contact with sub == '', in this case we show
real status of the account
=====================================
scripts/dev/plugins_translate
=====================================
--- a/scripts/dev/plugins_translate
+++ b/scripts/dev/plugins_translate
@@ -48,7 +48,7 @@ make_po()
make_mo()
{
if [ ! -f $1.po ]; then
- echo "$1.po doesn't existe. Use plugins_translation make_po $1 to create it.";
+ echo "$1.po doesn't exist. Use plugins_translation make_po $1 to create it.";
exit 3
fi
mkdir -p locale/$1/LC_MESSAGES
=====================================
test/unit/test_jingle.py
=====================================
--- a/test/unit/test_jingle.py
+++ b/test/unit/test_jingle.py
@@ -94,8 +94,8 @@ class TestJingle(unittest.TestCase):
self.con.connection = Connection()
'''
- Fake file_props when we recieve a file. Gajim creates a file_props
- out of a FileRequestRecieve event and from then on it changes in
+ Fake file_props when we receive a file. Gajim creates a file_props
+ out of a FileRequestReceive event and from then on it changes in
a lot of places. It is easier to just copy it in here.
If the session_initiate stanza changes, this also must change.
'''
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/d871dcdcb133ec397a15b88a71a37a9953…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/d871dcdcb133ec397a15b88a71a37a9953…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
1d27ab22 by Alexander Krotov at 2018-06-21T03:05:47+03:00
Spellcheck
- - - - -
10 changed files:
- gajim/common/configpaths.py
- gajim/common/connection.py
- gajim/common/file_props.py
- gajim/common/jingle.py
- gajim/common/pep.py
- gajim/common/socks5.py
- gajim/disco.py
- gajim/plugins/gajimplugin.py
- gajim/plugins/helpers.py
- gajim/plugins/pluginmanager.py
Changes:
=====================================
gajim/common/configpaths.py
=====================================
--- a/gajim/common/configpaths.py
+++ b/gajim/common/configpaths.py
@@ -84,7 +84,7 @@ def create_paths():
if not path.exists():
for parent_path in reversed(path.parents):
# Create all parent folders
- # dont use mkdir(parent=True), as it ignores `mode`
+ # don't use mkdir(parent=True), as it ignores `mode`
# when creating the parents
if not parent_path.exists():
print(('creating %s directory') % parent_path)
=====================================
gajim/common/connection.py
=====================================
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -75,7 +75,7 @@ SERVICE_DIRECT_TLS = 'xmpps-client'
class CommonConnection:
"""
- Common connection class, can be derivated for normal connection or zeroconf
+ Common connection class, can be derived for normal connection or zeroconf
connection
"""
@@ -119,7 +119,7 @@ class CommonConnection:
# Remember where we are in the register agent process
self.agent_registrations = {}
- # To know the groupchat jid associated with a sranza ID. Useful to
+ # To know the groupchat jid associated with a stanza ID. Useful to
# request vcard or os info... to a real JID but act as if it comes from
# the fake jid
self.groupchat_jids = {} # {ID : groupchat_jid}
@@ -164,7 +164,7 @@ class CommonConnection:
def reconnect(self):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
@@ -222,7 +222,7 @@ class CommonConnection:
def check_jid(self, jid):
"""
- This function must be implemented by derivated classes. It has to return
+ This function must be implemented by derived classes. It has to return
the valid jid, or raise a helpers.InvalidFormat exception
"""
raise NotImplementedError
@@ -404,44 +404,44 @@ class CommonConnection:
def ack_subscribed(self, jid):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def ack_unsubscribed(self, jid):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def request_subscription(self, jid, msg='', name='', groups=None,
auto_auth=False):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def send_authorization(self, jid):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def refuse_authorization(self, jid):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def unsubscribe(self, jid, remove_auth = True):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def unsubscribe_agent(self, agent):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
@@ -458,13 +458,13 @@ class CommonConnection:
def new_account(self, name, config, sync=False):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def _on_new_account(self, con=None, con_type=None):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
@@ -473,37 +473,37 @@ class CommonConnection:
def request_os_info(self, jid, resource):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def get_settings(self):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def get_bookmarks(self):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def store_bookmarks(self):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def get_metacontacts(self):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
def send_agent_status(self, agent, ptype):
"""
- To be implemented by derivated classes
+ To be implemented by derived classes
"""
raise NotImplementedError
=====================================
gajim/common/file_props.py
=====================================
--- a/gajim/common/file_props.py
+++ b/gajim/common/file_props.py
@@ -1,5 +1,5 @@
"""
-This module is in charge of taking care of all the infomation related to
+This module is in charge of taking care of all the information related to
individual files. Files are identified by the account name and its sid.
@@ -21,7 +21,7 @@ class FilesProp:
_files_props = {}
def __init__(self):
- raise Exception('this class should not be instatiated')
+ raise Exception('this class should not be instantiated')
@classmethod
def getNewFileProp(cls, account, sid):
@@ -93,7 +93,7 @@ class FilesProp:
class FileProp(object):
def __init__(self, account, sid):
- # Do not instatiate this class directly. Call FilesProp.getNeFileProp
+ # Do not instantiate this class directly. Call FilesProp.getNeFileProp
# instead
self.streamhosts = []
self.transfered_size = []
=====================================
gajim/common/jingle.py
=====================================
--- a/gajim/common/jingle.py
+++ b/gajim/common/jingle.py
@@ -76,7 +76,7 @@ class ConnectionJingle(object):
is a new session.
TODO: Also check if the stanza isn't an error stanza, if so route it
- adequatelly.
+ adequately.
"""
# get data
try:
@@ -209,7 +209,7 @@ class ConnectionJingle(object):
return sessions
def set_file_info(self, file_):
- # Saves information about the files we have transfered in case they need
+ # Saves information about the files we have transferred in case they need
# to be requested again.
self.files.append(file_)
=====================================
gajim/common/pep.py
=====================================
--- a/gajim/common/pep.py
+++ b/gajim/common/pep.py
@@ -466,7 +466,7 @@ class UserLocationPEP(AbstractPEP):
for entry in location.keys():
text = location[entry]
text = GLib.markup_escape_text(text)
- # Translate standart location tag
+ # Translate standard location tag
tag = LOCATION_DATA.get(entry, entry)
location_string += '\n<b>%(tag)s</b>: %(text)s' % \
{'tag': tag.capitalize(), 'text': text}
=====================================
gajim/common/socks5.py
=====================================
--- a/gajim/common/socks5.py
+++ b/gajim/common/socks5.py
@@ -80,7 +80,7 @@ class SocksQueue:
def start_listener(self, port, sha_str, sha_handler, file_props,
fingerprint=None, typ='sender'):
"""
- Start waiting for incomming connections on (host, port) and do a socks5
+ Start waiting for incoming connections on (host, port) and do a socks5
authentication using sid for generated SHA
"""
log.debug('Start listening for socks5 connection')
@@ -190,7 +190,7 @@ class SocksQueue:
self.remove_receiver(streamhost['idx'])
return
# set state -2, meaning that this streamhost is stopped,
- # but it may be connectected later
+ # but it may be connected later
if host['state'] >= 0:
if file_props.type_ == 's':
self.remove_sender(host['idx'], False)
@@ -406,7 +406,7 @@ class SocksQueue:
def remove_receiver(self, idx, do_disconnect=True, remove_all=False):
"""
- Remove reciver from the list and decrease the number of active
+ Remove receiver from the list and decrease the number of active
connections with 1
"""
if idx != -1:
=====================================
gajim/disco.py
=====================================
--- a/gajim/disco.py
+++ b/gajim/disco.py
@@ -131,7 +131,7 @@ class CacheDictionary:
"""
A dictionary that keeps items around for only a specific time. Lifetime is
in minutes. Getrefresh specifies whether to refresh when an item is merely
- accessed instead of set aswell
+ accessed instead of set as well
"""
def __init__(self, lifetime, getrefresh = True):
@@ -2087,7 +2087,7 @@ class DiscussionGroupsBrowser(AgentBrowser):
def update_actions(self):
"""
Called when user selected a row. Make subscribe/unsubscribe buttons
- sensitive appropriatelly
+ sensitive appropriately
"""
# we have nothing to do if we don't have buttons...
if self.subscribe_button is None: return
=====================================
gajim/plugins/gajimplugin.py
=====================================
--- a/gajim/plugins/gajimplugin.py
+++ b/gajim/plugins/gajimplugin.py
@@ -52,7 +52,7 @@ class GajimPlugin(object):
'''
Short name of plugin.
- Used for quick indentification of plugin.
+ Used for quick identification of plugin.
:type: str
@@ -114,7 +114,7 @@ class GajimPlugin(object):
Keys of this string should be strings with name of GUI extension point
to handles. Values should be 2-element tuples with references to handling
functions. First function will be used to connect plugin with extpoint,
- the second one to successfuly disconnect from it. Connecting takes places
+ the second one to successfully disconnect from it. Connecting takes places
when plugin is activated and extpoint already exists, or when plugin is
already activated but extpoint is being created (eg. chat window opens).
Disconnecting takes place when plugin is deactivated and extpoint exists
=====================================
gajim/plugins/helpers.py
=====================================
--- a/gajim/plugins/helpers.py
+++ b/gajim/plugins/helpers.py
@@ -51,7 +51,7 @@ class log_calls(object):
'GajimPluginConfigDialog', 'PluginsWindow']
'''
List of classes from which no logs should be emited when methods are called,
- eventhough `log_calls` decorator is used.
+ even though `log_calls` decorator is used.
'''
def __init__(self, classname='', log=log):
@@ -60,7 +60,7 @@ class log_calls(object):
classname : str
Name of class to prefix function name (if function is a method).
log : logging.Logger
- Logger to use when outputing debug information on when function has
+ Logger to use when outputting debug information on when function has
been entered and when left. By default: `plugins.helpers.log`
is used.
'''
=====================================
gajim/plugins/pluginmanager.py
=====================================
--- a/gajim/plugins/pluginmanager.py
+++ b/gajim/plugins/pluginmanager.py
@@ -60,7 +60,7 @@ class PluginManager(metaclass=Singleton):
:todo: implement mechanism to dynamically load plugins where GUI extension
points have been already called (i.e. when plugin is activated
after GUI object creation). [DONE?]
- :todo: implement mechanism to dynamically deactive plugins (call plugin's
+ :todo: implement mechanism to dynamically deactivate plugins (call plugin's
deactivation handler) [DONE?]
:todo: when plug-in is deactivated all GUI extension points are removed
from `PluginManager.gui_extension_points_handlers`. But when
@@ -155,7 +155,7 @@ class PluginManager(metaclass=Singleton):
'''
removes the plugin from the plugin list and deletes all loaded modules
from sys. This way we will have a fresh start when the plugin gets added
- agin.
+ again.
'''
if plugin.active:
self.deactivate_plugin(plugin)
@@ -192,7 +192,7 @@ class PluginManager(metaclass=Singleton):
def extension_point(self, gui_extpoint_name, *args):
'''
Invokes all handlers (from plugins) for a particular extension point, but
- doesnt add it to collection for further processing.
+ doesn't add it to collection for further processing.
For example if you pass a message for encryption via extension point to a
plugin, its undesired that the call is stored and replayed on activating the
plugin. For example after an update.
@@ -487,7 +487,7 @@ class PluginManager(metaclass=Singleton):
:rtype: [] of class objects
:note: currently it only searches for plugin classes in '\*.py' files
- present in given direcotory `path` (no recursion here)
+ present in given directory `path` (no recursion here)
:todo: add scanning zipped modules
'''
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/1d27ab2254618cbdf1e6c67192b4691727…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/1d27ab2254618cbdf1e6c67192b4691727…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
22d799a7 by Alexander Krotov at 2018-06-19T19:07:16+02:00
Set secure_delete pragma for SQLite3 connections
secure_delete makes SQLite3 overwrite deleted data with zeros, thus actually deleting it from the filesystem.
Ubuntu and FreeBSD enable it by defualt, but some distributions, such as Debian, have it disabled by default, so it is better to set it explicitly.
The performance impact should be negligible as Gajim uses the database rarely.
- - - - -
2 changed files:
- gajim/common/logger.py
- gajim/history_manager.py
Changes:
=====================================
gajim/common/logger.py
=====================================
--- a/gajim/common/logger.py
+++ b/gajim/common/logger.py
@@ -158,9 +158,15 @@ class Logger:
self._create(CACHE_SQL_STATEMENT, self._cache_db_path)
@staticmethod
- def _create(statement, path):
+ def _connect(*args, **kwargs):
+ con = sqlite.connect(*args, **kwargs)
+ con.execute("PRAGMA secure_delete=1")
+ return con
+
+ @classmethod
+ def _create(cls, statement, path):
log.info(_('Creating %s'), path)
- con = sqlite.connect(path)
+ con = cls._connect(path)
os.chmod(path, 0o600)
try:
@@ -181,11 +187,11 @@ class Logger:
def _migrate_databases(self):
try:
- con = sqlite.connect(self._log_db_path)
+ con = self._connect(self._log_db_path)
self._migrate_logs(con)
con.close()
- con = sqlite.connect(self._cache_db_path)
+ con = self._connect(self._cache_db_path)
self._migrate_cache(con)
con.close()
except Exception:
@@ -272,7 +278,7 @@ class Logger:
app.ged.raise_event(event, None, str(error))
def _connect_databases(self):
- self._con = sqlite.connect(
+ self._con = self._connect(
self._log_db_path, timeout=20.0, isolation_level='IMMEDIATE')
self._con.row_factory = self.namedtuple_factory
=====================================
gajim/history_manager.py
=====================================
--- a/gajim/history_manager.py
+++ b/gajim/history_manager.py
@@ -131,6 +131,7 @@ class HistoryManager:
self.con = sqlite3.connect(
log_db_path, timeout=20.0, isolation_level='IMMEDIATE')
+ self.con.execute("PRAGMA secure_delete=1")
self.cur = self.con.cursor()
self._init_jids_listview()
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/22d799a75ef8fcaec4b0c9a14ca8473f4e…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/22d799a75ef8fcaec4b0c9a14ca8473f4e…
You're receiving this email because of your account on dev.gajim.org.