changeset aacbaf27ca98 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=aacbaf27ca98
description: remove call to unicode()
diffstat:
src/adhoc_commands.py | 3 -
src/chat_control.py | 2 +-
src/command_system/dispatcher.py | 2 +-
src/command_system/framework.py | 8 +-
src/command_system/implementation/custom.py | 2 +-
src/command_system/implementation/execute.py | 2 +-
src/command_system/implementation/standard.py | 4 +-
src/command_system/mapping.py | 8 +--
src/common/check_paths.py | 2 +-
src/common/commands.py | 6 +-
src/common/configpaths.py | 2 +-
src/common/connection.py | 10 +-
src/common/connection_handlers.py | 8 +-
src/common/connection_handlers_events.py | 8 +-
src/common/dataforms.py | 4 +-
src/common/gajim.py | 11 +--
src/common/gpg.py | 2 +-
src/common/helpers.py | 94 +++++++++++++-------------
src/common/i18n.py | 4 +-
src/common/jingle_xtls.py | 2 +-
src/common/kwalletbinding.py | 2 +-
src/common/logger.py | 4 +-
src/common/logging_helpers.py | 2 +-
src/common/message_archiving.py | 2 +-
src/common/optparser.py | 9 +--
src/common/protocol/bytestream.py | 42 ++++++------
src/common/proxy65_manager.py | 2 +-
src/common/zeroconf/client_zeroconf.py | 11 +--
src/common/zeroconf/connection_zeroconf.py | 7 +-
src/common/zeroconf/zeroconf_avahi.py | 9 +--
src/config.py | 24 +++---
src/conversation_textview.py | 4 -
src/dataforms_widget.py | 2 +-
src/dialogs.py | 2 +-
src/filetransfers_window.py | 14 ++--
src/gajim-remote.py | 16 +---
src/gajim.py | 6 +-
src/gajim_themes_window.py | 6 +-
src/groupchat_control.py | 10 +--
src/gui_interface.py | 14 ++--
src/message_window.py | 6 +-
src/plugins/plugin.py | 14 ++--
src/plugins/pluginmanager.py | 6 +-
src/remote_control.py | 12 +-
src/roster_window.py | 6 +-
src/tooltips.py | 15 +---
src/vcard.py | 16 ++--
47 files changed, 190 insertions(+), 257 deletions(-)
diffs (truncated from 1529 to 300 lines):
diff -r dd54d6b1df5d -r aacbaf27ca98 src/adhoc_commands.py
--- a/src/adhoc_commands.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/adhoc_commands.py Tue Jan 01 21:06:16 2013 +0100
@@ -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(
@@ -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 dd54d6b1df5d -r aacbaf27ca98 src/chat_control.py
--- a/src/chat_control.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/chat_control.py Tue Jan 01 21:06:16 2013 +0100
@@ -2505,7 +2505,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')
diff -r dd54d6b1df5d -r aacbaf27ca98 src/command_system/dispatcher.py
--- a/src/command_system/dispatcher.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/command_system/dispatcher.py Tue Jan 01 21:06:16 2013 +0100
@@ -32,7 +32,7 @@
"""
from types import NoneType
-from tools import remove
+from .tools import remove
COMMANDS = {}
CONTAINERS = {}
diff -r dd54d6b1df5d -r aacbaf27ca98 src/command_system/framework.py
--- a/src/command_system/framework.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/command_system/framework.py Tue Jan 01 21:06:16 2013 +0100
@@ -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
+from mmapping import parse_arguments, adapt_arguments
+from .errors import DefinitionError, CommandError, NoCommandError
class CommandHost(object):
"""
diff -r dd54d6b1df5d -r aacbaf27ca98 src/command_system/implementation/custom.py
--- a/src/command_system/implementation/custom.py Tue Jan 01 19:44:25
2013 +0100
+++ b/src/command_system/implementation/custom.py Tue Jan 01 21:06:16
2013 +0100
@@ -35,7 +35,7 @@
"""
from ..framework import CommandContainer, command, doc
-from hosts import *
+from .hosts import *
class CustomCommonCommands(CommandContainer):
"""
diff -r dd54d6b1df5d -r aacbaf27ca98
src/command_system/implementation/execute.py
--- a/src/command_system/implementation/execute.py Tue Jan 01 19:44:25
2013 +0100
+++ b/src/command_system/implementation/execute.py Tue Jan 01 21:06:16
2013 +0100
@@ -38,7 +38,7 @@
from glib import timeout_add
from ..framework import CommandContainer, command, doc
-from hosts import *
+from .hosts import *
class Execute(CommandContainer):
AUTOMATIC = True
diff -r dd54d6b1df5d -r aacbaf27ca98
src/command_system/implementation/standard.py
--- a/src/command_system/implementation/standard.py Tue Jan 01 19:44:25
2013 +0100
+++ b/src/command_system/implementation/standard.py Tue Jan 01 21:06:16
2013 +0100
@@ -30,8 +30,8 @@
from ..framework import CommandContainer, command, doc
from ..mapping import generate_usage
-from hosts import *
-import execute
+from .hosts import *
+from . import execute
# This holds constants fron the logger, which we'll be using in some of our
# commands.
diff -r dd54d6b1df5d -r aacbaf27ca98 src/command_system/mapping.py
--- a/src/command_system/mapping.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/command_system/mapping.py Tue Jan 01 21:06:16 2013 +0100
@@ -26,7 +26,7 @@
from types import BooleanType, UnicodeType
from operator import itemgetter
-from errors import DefinitionError, CommandError
+from .errors import DefinitionError, CommandError
# Quite complex piece of regular expression logic to parse options and
# arguments. Might need some tweaking along the way.
@@ -269,12 +269,6 @@
if not isinstance(value, BooleanType):
raise CommandError("%s: Switch can not take an argument" %
key, command)
- # We need to encode every keyword argument to a simple string, not
- # the unicode one, because ** expansion does not support it.
- for index, (key, value) in enumerate(opts):
- if isinstance(key, UnicodeType):
- opts[index] = (key.encode(KEY_ENCODING), value)
-
# Inject the source arguments as a string as a first argument, if
# command has enabled the corresponding option.
if command.source:
diff -r dd54d6b1df5d -r aacbaf27ca98 src/common/check_paths.py
--- a/src/common/check_paths.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/common/check_paths.py Tue Jan 01 21:06:16 2013 +0100
@@ -29,7 +29,7 @@
import stat
from common import gajim
-import logger
+from common import logger
from common import jingle_xtls
# DO NOT MOVE ABOVE OF import gajim
diff -r dd54d6b1df5d -r aacbaf27ca98 src/common/commands.py
--- a/src/common/commands.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/common/commands.py Tue Jan 01 21:06:16 2013 +0100
@@ -23,9 +23,9 @@
##
import nbxmpp
-import helpers
-import dataforms
-import gajim
+from common import helpers
+from common import dataforms
+from common import gajim
import logging
log = logging.getLogger('gajim.c.commands')
diff -r dd54d6b1df5d -r aacbaf27ca98 src/common/configpaths.py
--- a/src/common/configpaths.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/common/configpaths.py Tue Jan 01 21:06:16 2013 +0100
@@ -61,7 +61,7 @@
"""
Convert from filesystem encoding if not already Unicode
"""
- return unicode(s, sys.getfilesystemencoding())
+ return s
def windowsify(s):
if os.name == 'nt':
diff -r dd54d6b1df5d -r aacbaf27ca98 src/common/connection.py
--- a/src/common/connection.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/common/connection.py Tue Jan 01 21:06:16 2013 +0100
@@ -616,7 +616,7 @@
if realm == '':
if event == nbxmpp.transports_nb.DATA_RECEIVED:
gajim.nec.push_incoming_event(StanzaReceivedEvent(None,
- conn=self, stanza_str=unicode(data, errors='ignore')))
+ conn=self, stanza_str=data))
elif event == nbxmpp.transports_nb.DATA_SENT:
gajim.nec.push_incoming_event(StanzaSentEvent(None, conn=self,
stanza_str=data))
@@ -1446,7 +1446,7 @@
self.connection.send(' ')
def _on_xmpp_ping_answer(self, iq_obj):
- id_ = unicode(iq_obj.getAttr('id'))
+ id_ = iq_obj.getAttr('id')
assert id_ == self.awaiting_xmpp_ping_id
self.awaiting_xmpp_ping_id = None
@@ -1607,7 +1607,7 @@
self.activate_privacy_rule('invisible')
self.connected = gajim.SHOW_LIST.index('invisible')
self.status = msg
- priority = unicode(gajim.get_priority(self.name, 'invisible'))
+ priority = gajim.get_priority(self.name, 'invisible')
p = nbxmpp.Presence(priority=priority)
p = self.add_sha(p, True)
if msg:
@@ -1781,7 +1781,7 @@
p.setStatus(msg)
else:
signed = self.get_signed_presence(msg)
- priority = unicode(gajim.get_priority(self.name, sshow))
+ priority = gajim.get_priority(self.name, sshow)
p = nbxmpp.Presence(typ=None, priority=priority, show=sshow,
to=jid)
p = self.add_sha(p)
if msg:
@@ -1805,7 +1805,7 @@
def _update_status(self, show, msg):
xmpp_show = helpers.get_xmpp_show(show)
- priority = unicode(gajim.get_priority(self.name, xmpp_show))
+ priority = gajim.get_priority(self.name, xmpp_show)
p = nbxmpp.Presence(typ=None, priority=priority, show=xmpp_show)
p = self.add_sha(p)
if msg:
diff -r dd54d6b1df5d -r aacbaf27ca98 src/common/connection_handlers.py
--- a/src/common/connection_handlers.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/common/connection_handlers.py Tue Jan 01 21:06:16 2013 +0100
@@ -39,7 +39,7 @@
from calendar import timegm
import nbxmpp
-import common.caps_cache as capscache
+from common import caps_cache as capscache
from common import helpers
from common import gajim
@@ -181,8 +181,8 @@
if not self.connection or self.connected < 2:
return
frm = helpers.get_full_jid_from_iq(iq_obj)
- to = unicode(iq_obj.getAttr('to'))
- id_ = unicode(iq_obj.getAttr('id'))
+ to = iq_obj.getAttr('to')
+ id_ = iq_obj.getAttr('id')
iq = nbxmpp.Iq(to=frm, typ='result', queryNS=nbxmpp.NS_DISCO, frm=to)
iq.setAttr('id', id_)
query = iq.setTag('query')
@@ -235,7 +235,7 @@
if self.commandInfoQuery(con, iq_obj):
raise nbxmpp.NodeProcessed
- id_ = unicode(iq_obj.getAttr('id'))
+ id_ = iq_obj.getAttr('id')
if id_[:6] == 'Gajim_':
# We get this request from echo.server
raise nbxmpp.NodeProcessed
diff -r dd54d6b1df5d -r aacbaf27ca98 src/common/connection_handlers_events.py
--- a/src/common/connection_handlers_events.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/common/connection_handlers_events.py Tue Jan 01 21:06:16 2013 +0100
@@ -39,7 +39,7 @@
from common.jingle_transport import JingleTransportSocks5
from common.file_props import FilesProp
-import gtkgui_helpers
+from . import gtkgui_helpers
import logging
log = logging.getLogger('gajim.c.connection_handlers_events')
@@ -1169,7 +1169,6 @@
self.fjid = key
break
- self.fjid = unicode(self.fjid)
self.jid, self.resource = gajim.get_room_and_nick_from_fjid(self.fjid)
def generate(self):
@@ -1986,7 +1985,7 @@
self.FT_content.session.ourjid)
self.FT_content.transport.set_connection(
self.FT_content.session.connection)
- sid = unicode(self.stanza.getTag('jingle').getAttr('sid'))
+ sid = self.stanza.getTag('jingle').getAttr('sid')
self.file_props = FilesProp.getNewFileProp(self.conn.name, sid)
self.file_props.transport_sid = self.FT_content.transport.sid
self.FT_content.file_props = self.file_props
@@ -2033,8 +2032,7 @@
else:
si = self.stanza.getTag('si')
self.file_props = FilesProp.getNewFileProp(self.conn.name,
- unicode(si.getAttr('id'))
- )
+ si.getAttr('id'))
profile = si.getAttr('profile')
if profile != nbxmpp.NS_FILE:
self.conn.send_file_rejection(self.file_props, code='400',
diff -r dd54d6b1df5d -r aacbaf27ca98 src/common/dataforms.py
--- a/src/common/dataforms.py Tue Jan 01 19:44:25 2013 +0100
+++ b/src/common/dataforms.py Tue Jan 01 21:06:16 2013 +0100
@@ -27,7 +27,7 @@
"""
import nbxmpp
-import helpers
+from common import helpers
# exceptions used in this module
# base class
@@ -345,7 +345,7 @@
@nested_property
def value():
"""
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits