From f4ad05a45abb47d6cfc8566ee650e146b3c39c2e Mon Sep 17 00:00:00 2001 From: Denis Fomin Date: Sun, 27 Jan 2013 12:35:20 +0400 Subject: [PATCH] ChatstatePlugin. gtk3 support --- chatstate/__init__.py | 2 +- chatstate/chatstate.py | 14 +++++++------- chatstate/manifest.ini | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/chatstate/__init__.py b/chatstate/__init__.py index 2e0e6b6..46280c9 100644 --- a/chatstate/__init__.py +++ b/chatstate/__init__.py @@ -1 +1 @@ -from chatstate import ChatstatePlugin +from .chatstate import ChatstatePlugin diff --git a/chatstate/chatstate.py b/chatstate/chatstate.py index 274c6b7..28a8f65 100644 --- a/chatstate/chatstate.py +++ b/chatstate/chatstate.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ## -import gobject +from gi.repository import GObject from plugins import GajimPlugin from plugins.helpers import log_calls @@ -21,11 +21,11 @@ def paragraph_direction_mark(text): for char in text: bidi = unicodedata.bidirectional(char) if bidi == 'L': - return u'\u200E' + return '\u200E' elif bidi == 'AL' or bidi == 'R': - return u'\u200F' + return '\u200F' - return u'\u200E' + return '\u200E' class ChatstatePlugin(GajimPlugin): @@ -57,7 +57,7 @@ class ChatstatePlugin(GajimPlugin): child_iters = gajim.interface.roster._get_contact_iter(obj.jid, obj.conn.name, contact, self.model) - name = gobject.markup_escape_text(contact.get_shown_name()) + name = GObject.markup_escape_text(contact.get_shown_name()) contact_instances = gajim.contacts.get_contacts(obj.conn.name, contact.jid) @@ -68,7 +68,7 @@ class ChatstatePlugin(GajimPlugin): nb_connected_contact += 1 if nb_connected_contact > 1: name += paragraph_direction_mark(unicode(name)) - name += u' (%d)' % nb_connected_contact + name += ' (%d)' % nb_connected_contact for child_iter in child_iters: if chatstate != 'gone': @@ -82,7 +82,7 @@ class ChatstatePlugin(GajimPlugin): max_lines=1) name += '\n%s' % (self.status_color, - gobject.markup_escape_text(status)) + GObject.markup_escape_text(status)) self.model[child_iter][1] = name @log_calls('ChatstatePlugin') diff --git a/chatstate/manifest.ini b/chatstate/manifest.ini index 578089b..47f7f33 100644 --- a/chatstate/manifest.ini +++ b/chatstate/manifest.ini @@ -7,4 +7,4 @@ description: Chat State Notifications in roster. The plugin does not work if you use custom font color for contacts in roster. authors = Denis Fomin homepage = http://trac-plugins.gajim.org/wiki/ChatstatePlugin -max_gajim_version: 0.15.9 +min_gajim_version: 0.15.10