changeset 9ad3483d0c75 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=9ad3483d0c75
description: Merge
diffstat:
plugins/dbus_plugin/plugin.py | 6 +-
src/adhoc_commands.py | 9 +-
src/advanced_configuration_window.py | 33 +--
src/atom_window.py | 6 +-
src/chat_control.py | 12 +-
src/command_system/dispatcher.py | 7 +-
src/command_system/framework.py | 12 +-
src/command_system/implementation/custom.py | 2 +-
src/command_system/implementation/execute.py | 8 +-
src/command_system/implementation/middleware.py | 7 +-
src/command_system/implementation/standard.py | 4 +-
src/command_system/mapping.py | 31 +--
src/common/atom.py | 6 +-
src/common/caps_cache.py | 11 +-
src/common/check_paths.py | 100 +++++-----
src/common/commands.py | 26 +-
src/common/config.py | 18 +-
src/common/configpaths.py | 72 ++++----
src/common/connection.py | 14 +-
src/common/connection_handlers.py | 42 ++--
src/common/connection_handlers_events.py | 50 +++-
src/common/contacts.py | 10 +-
src/common/dataforms.py | 12 +-
src/common/dbus_support.py | 18 +-
src/common/file_props.py | 2 +-
src/common/gajim.py | 25 +-
src/common/ged.py | 4 +-
src/common/gpg.py | 4 +-
src/common/helpers.py | 156 ++++++++---------
src/common/i18n.py | 12 +-
src/common/idle.py | 6 +-
src/common/jingle.py | 12 +-
src/common/jingle_content.py | 4 +-
src/common/jingle_ft.py | 8 +-
src/common/jingle_ftstates.py | 4 +-
src/common/jingle_rtp.py | 17 +-
src/common/jingle_session.py | 11 +-
src/common/jingle_transport.py | 4 +-
src/common/jingle_xtls.py | 11 +-
src/common/kwalletbinding.py | 4 +-
src/common/logger.py | 67 +++---
src/common/logging_helpers.py | 12 +-
src/common/message_archiving.py | 2 +-
src/common/multimedia_helpers.py | 2 +-
src/common/nec.py | 2 +-
src/common/optparser.py | 32 +--
src/common/passwords.py | 2 +-
src/common/pep.py | 40 ----
src/common/protocol/bytestream.py | 49 ++--
src/common/proxy65_manager.py | 8 +-
src/common/pubsub.py | 14 +-
src/common/resolver.py | 27 +-
src/common/rst_xhtml_generator.py | 18 +-
src/common/sleepy.py | 3 +-
src/common/socks5.py | 46 ++--
src/common/stanza_session.py | 2 +-
src/common/zeroconf/client_zeroconf.py | 37 +--
src/common/zeroconf/connection_zeroconf.py | 9 +-
src/common/zeroconf/roster_zeroconf.py | 12 -
src/common/zeroconf/zeroconf_avahi.py | 23 +-
src/common/zeroconf/zeroconf_bonjour.py | 8 +-
src/config.py | 181 +++++++++-----------
src/conversation_textview.py | 14 +-
src/dataforms_widget.py | 14 +-
src/dialogs.py | 114 ++++++------
src/disco.py | 61 +++---
src/features_window.py | 2 +-
src/filetransfers_window.py | 34 +-
src/gajim-remote.py | 33 +--
src/gajim.py | 38 ++--
src/gajim_themes_window.py | 11 +-
src/groupchat_control.py | 42 ++--
src/gtkexcepthook.py | 6 +-
src/gtkgui_helpers.py | 93 ++++++----
src/gui_interface.py | 50 ++--
src/gui_menu_builder.py | 2 +-
src/history_manager.py | 16 +-
src/history_window.py | 6 +-
src/htmltextview.py | 17 +-
src/ipython_view.py | 4 +-
src/message_window.py | 12 +-
src/music_track_listener.py | 8 +-
src/notify.py | 13 +-
src/plugins/__init__.py | 4 +-
src/plugins/gui.py | 10 +-
src/plugins/helpers.py | 2 +-
src/plugins/plugin.py | 32 +-
src/plugins/pluginmanager.py | 48 ++--
src/plugins/plugins_i18n.py | 2 +-
src/profile_window.py | 9 +-
src/remote_control.py | 18 +-
src/roster_window.py | 207 +++++++++++------------
src/session.py | 14 +-
src/statusicon.py | 2 +-
src/tooltips.py | 19 +-
src/vcard.py | 18 +-
test/integration/test_resolver.py | 2 +-
test/integration/test_roster.py | 4 +-
test/integration/test_xmpp_client_nb.py | 2 +-
test/integration/test_xmpp_transports_nb.py | 2 +-
test/lib/data.py | 90 +++++-----
test/lib/mock.py | 2 +-
test/runtests.py | 10 +-
test/unit/test_jingle.py | 82 ++++----
test/unit/test_socks5.py | 84 ++++----
test/unit/test_xmpp_transports_nb.py | 30 +-
106 files changed, 1284 insertions(+), 1395 deletions(-)
diffs (truncated from 8657 to 300 lines):
diff -r 4d25a6cba824 -r 9ad3483d0c75 plugins/dbus_plugin/plugin.py
--- a/plugins/dbus_plugin/plugin.py Wed Jan 02 20:57:20 2013 +0400
+++ b/plugins/dbus_plugin/plugin.py Wed Jan 02 22:13:27 2013 +0400
@@ -407,7 +407,7 @@
return DBUS_DICT_SV()
jid = self._get_real_jid(jid)
- cached_vcard =
gajim.connections.values()[0].get_cached_vcard(jid)
+ cached_vcard =
list(gajim.connections.values())[0].get_cached_vcard(jid)
if cached_vcard:
return get_dbus_struct(cached_vcard)
@@ -428,7 +428,7 @@
def account_info(self, account):
'''show info on account: resource, jid, nick, prio, message'''
result = DBUS_DICT_SS()
- if gajim.connections.has_key(account):
+ if account in gajim.connections:
# account is valid
con = gajim.connections[account]
index = con.connected
@@ -508,7 +508,7 @@
def prefs_store(self):
try:
gajim.interface.save_config()
- except Exception, e:
+ except Exception as e:
return DBUS_BOOLEAN(False)
return DBUS_BOOLEAN(True)
diff -r 4d25a6cba824 -r 9ad3483d0c75 src/adhoc_commands.py
--- a/src/adhoc_commands.py Wed Jan 02 20:57:20 2013 +0400
+++ b/src/adhoc_commands.py Wed Jan 02 22:13:27 2013 +0400
@@ -159,7 +159,7 @@
return self.stage_adhoc_commands_window_delete_event(self.window)
def __del__(self):
- print 'Object has been deleted.'
+ print('Object has been deleted.')
# stage 1: waiting for command list
def stage1(self):
@@ -281,8 +281,6 @@
# close old stage
self.stage_finish()
- assert isinstance(self.commandnode, unicode)
-
self.form_status = None
self.stages_notebook.set_current_page(
@@ -452,7 +450,7 @@
note = command.getTag('note')
if note:
- self.notes_label.set_text(note.getData().decode('utf-8'))
+ self.notes_label.set_text(note.getData())
self.notes_label.set_no_show_all(False)
self.notes_label.show()
else:
@@ -510,7 +508,7 @@
try:
errorname = nbxmpp.NS_STANZAS + ' ' + str(errorid)
errordesc = nbxmpp.ERRORS[errorname][2]
- error = errordesc.decode('utf-8')
+ error = errordesc
del errorname, errordesc
except KeyError: # when stanza doesn't have error
description
error = _('Service returned an error.')
@@ -608,7 +606,6 @@
Send the command with data form. Wait for reply
"""
# create the stanza
- assert isinstance(self.commandnode, unicode)
assert action in ('execute', 'prev', 'next', 'complete')
stanza = nbxmpp.Iq(typ='set', to=self.jid)
diff -r 4d25a6cba824 -r 9ad3483d0c75 src/advanced_configuration_window.py
--- a/src/advanced_configuration_window.py Wed Jan 02 20:57:20 2013 +0400
+++ b/src/advanced_configuration_window.py Wed Jan 02 22:13:27 2013 +0400
@@ -141,8 +141,7 @@
"""
optname = model[iter_][C_PREFNAME]
opttype = model[iter_][C_TYPE]
-
- if opttype.decode('utf-8') == self.types['boolean'] or optname ==
'password':
+ if opttype == self.types['boolean'] or optname == 'password':
cell.set_property('editable', False)
else:
cell.set_property('editable', True)
@@ -153,10 +152,10 @@
# path[1] is the key name
# path[2] is the root of tree
# last two is optional
- path = [model[iter_][0].decode('utf-8')]
+ path = [model[iter_][0]]
parent = model.iter_parent(iter_)
while parent:
- path.append(model[parent][0].decode('utf-8'))
+ path.append(model[parent][0])
parent = model.iter_parent(parent)
return path
@@ -194,17 +193,17 @@
def on_advanced_treeview_row_activated(self, treeview, path, column):
modelpath = self.modelfilter.convert_path_to_child_path(path)
modelrow = self.model[modelpath]
- option = modelrow[0].decode('utf-8')
- if modelrow[2].decode('utf-8') == self.types['boolean']:
+ option = modelrow[0]
+ if modelrow[2] == self.types['boolean']:
for key in self.right_true_dict.keys():
- if self.right_true_dict[key] == modelrow[1].decode('utf-8'):
+ if self.right_true_dict[key] == modelrow[1]:
modelrow[1] = str(key)
newval = {'False': True, 'True': False}[modelrow[1]]
if len(modelpath.get_indices()) > 1:
optnamerow = self.model[modelpath.get_indices()[0]]
- optname = optnamerow[0].decode('utf-8')
+ optname = optnamerow[0]
keyrow = self.model[modelpath.get_indices()[:2]]
- key = keyrow[0].decode('utf-8')
+ key = keyrow[0]
self.remember_option(option + '\n' + key + '\n' + optname,
modelrow[1], newval)
gajim.config.set_per(optname, key, option, newval)
@@ -234,13 +233,12 @@
modelpath = self.modelfilter.convert_path_to_child_path(path)
modelrow = self.model[modelpath]
modelpath = modelpath.get_indices()
- option = modelrow[0].decode('utf-8')
- text = text.decode('utf-8')
+ option = modelrow[0]
if len(modelpath) > 1:
optnamerow = self.model[modelpath[0]]
- optname = optnamerow[0].decode('utf-8')
+ optname = optnamerow[0]
keyrow = self.model[modelpath[:2]]
- key = keyrow[0].decode('utf-8')
+ key = keyrow[0]
self.remember_option(option + '\n' + key + '\n' + optname,
modelrow[1],
text)
gajim.config.set_per(optname, key, option, text)
@@ -269,12 +267,12 @@
return
modelpath = self.modelfilter.convert_path_to_child_path(path)
modelrow = self.model[modelpath]
- option = modelrow[0].decode('utf-8')
+ option = modelrow[0]
if len(modelpath) > 1:
optnamerow = self.model[modelpath[0]]
- optname = optnamerow[0].decode('utf-8')
+ optname = optnamerow[0]
keyrow = self.model[modelpath[:2]]
- key = keyrow[0].decode('utf-8')
+ key = keyrow[0]
self.remember_option(option + '\n' + key + '\n' + optname,
modelrow[C_VALUE], default)
gajim.config.set_per(optname, key, option, default)
@@ -313,11 +311,10 @@
value = str(option)
except:
value = option
- value = helpers.ensure_utf8_string(value)
self.model.append(parent, [name, value, type_])
def visible_func(self, model, treeiter, data):
- search_string = self.entry.get_text().decode('utf-8').lower()
+ search_string = self.entry.get_text().lower()
for it in tree_model_pre_order(model, treeiter):
if model[it][C_TYPE] != '':
opt_path = self.get_option_path(model, it)
diff -r 4d25a6cba824 -r 9ad3483d0c75 src/atom_window.py
--- a/src/atom_window.py Wed Jan 02 20:57:20 2013 +0400
+++ b/src/atom_window.py Wed Jan 02 22:13:27 2013 +0400
@@ -84,20 +84,20 @@
# fill the fields
if newentry.feed_link is not None:
self.feed_title_label.set_markup(
- u'<span foreground="blue" underline="single">%s</span>' % \
+ '<span foreground="blue" underline="single">%s</span>' % \
GObject.markup_escape_text(newentry.feed_title))
else:
self.feed_title_label.set_markup(
GObject.markup_escape_text(newentry.feed_title))
self.feed_tagline_label.set_markup(
- u'<small>%s</small>' % \
+ '<small>%s</small>' % \
GObject.markup_escape_text(newentry.feed_tagline))
if newentry.title:
if newentry.uri is not None:
self.entry_title_label.set_markup(
- u'<span foreground="blue" underline="single">%s</span>' % \
+ '<span foreground="blue" underline="single">%s</span>' % \
GObject.markup_escape_text(newentry.title))
else:
self.entry_title_label.set_markup(
diff -r 4d25a6cba824 -r 9ad3483d0c75 src/chat_control.py
--- a/src/chat_control.py Wed Jan 02 20:57:20 2013 +0400
+++ b/src/chat_control.py Wed Jan 02 22:13:27 2013 +0400
@@ -620,7 +620,7 @@
message_buffer = self.msg_textview.get_buffer()
start_iter = message_buffer.get_start_iter()
end_iter = message_buffer.get_end_iter()
- message = message_buffer.get_text(start_iter, end_iter,
False).decode('utf-8')
+ message = message_buffer.get_text(start_iter, end_iter, False)
xhtml = self.msg_textview.get_xhtml()
# send the message
@@ -917,7 +917,7 @@
scroll = False if pos == size else True # are we scrolling?
# we don't want size of the buffer to grow indefinately
max_size = gajim.config.get('key_up_lines')
- for i in xrange(size - max_size + 1):
+ for i in range(size - max_size + 1):
if pos == 0:
break
history.pop(0)
@@ -1786,7 +1786,7 @@
pep = self.contact.pep
img = self._pep_images[pep_type]
if pep_type in pep:
- img.set_from_pixbuf(pep[pep_type].asPixbufIcon())
+
img.set_from_pixbuf(gtkgui_helpers.get_pep_as_pixbuf(pep[pep_type]))
img.set_tooltip_markup(pep[pep_type].asMarkupText())
img.show()
else:
@@ -2506,7 +2506,7 @@
if num_unread == 1 and not gajim.config.get('show_unread_tab_icon'):
unread = '*'
elif num_unread > 1:
- unread = '[' + unicode(num_unread) + ']'
+ unread = '[' + str(num_unread) + ']'
# Draw tab label using chatstate
theme = gajim.config.get('roster_theme')
@@ -2843,7 +2843,7 @@
type_ = model[iter_][2]
if type_ != 'contact': # source is not a contact
return
- dropped_jid = data.decode('utf-8')
+ dropped_jid = data
dropped_transport = gajim.get_transport_name_from_jid(dropped_jid)
c_transport = gajim.get_transport_name_from_jid(c.jid)
@@ -3021,7 +3021,7 @@
# It's why I set it transparent.
image = self.xml.get_object('avatar_image')
pixbuf = image.get_pixbuf()
- pixbuf.fill(0xffffff00L) # RGBA
+ pixbuf.fill(0xffffff00) # RGBA
image.queue_draw()
screen_w = Gdk.Screen.width()
diff -r 4d25a6cba824 -r 9ad3483d0c75 src/command_system/dispatcher.py
--- a/src/command_system/dispatcher.py Wed Jan 02 20:57:20 2013 +0400
+++ b/src/command_system/dispatcher.py Wed Jan 02 22:13:27 2013 +0400
@@ -31,8 +31,7 @@
over the process.
"""
-from types import NoneType
-from tools import remove
+from .tools import remove
COMMANDS = {}
CONTAINERS = {}
@@ -71,7 +70,7 @@
return isinstance(attribute, Command)
def is_root(namespace):
- metaclass = namespace.get("__metaclass__", NoneType)
+ metaclass = namespace.get("__metaclass__", None)
return issubclass(metaclass, Dispatchable)
def get_command(host, name):
@@ -83,7 +82,7 @@
def list_commands(host):
for container in CONTAINERS[host]:
commands = COMMANDS[container]
- for name, command in commands.iteritems():
+ for name, command in commands.items():
yield name, command
class Dispatchable(type):
diff -r 4d25a6cba824 -r 9ad3483d0c75 src/command_system/framework.py
--- a/src/command_system/framework.py Wed Jan 02 20:57:20 2013 +0400
+++ b/src/command_system/framework.py Wed Jan 02 22:13:27 2013 +0400
@@ -23,10 +23,10 @@
from types import FunctionType
from inspect import getargspec, getdoc
-from dispatcher import Host, Container
-from dispatcher import get_command, list_commands
-from mapping import parse_arguments, adapt_arguments
-from errors import DefinitionError, CommandError, NoCommandError
+from .dispatcher import Host, Container
+from .dispatcher import get_command, list_commands
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits