Run pygi-convert.sh for automatic conversion from GTK2 to GTK3 + pygi.

This is only on a best-effort basis; the code will be in a broken state after
this patch and need to be fixed manually.

The purpose of committing the intermediate, non-working output is to make it
reproducible. It's impractical to manually review the changes.

The exact version used was 4f637212f13b197a95c824967a58496b9e3b877c from the
main pygobject repository [1] plus a custom patch [2] that hasn't been sent
upstream yet.

[1] git://git.gnome.org/pygobject
[2] https://sascha.silbe.org/patches/pygobject-convert-sugar-20111122.patch

Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
This commit is contained in:
Sascha Silbe
2011-11-15 19:29:07 +01:00
committed by Simon Schampijer
parent aed295ec4e
commit 820efa56b9
47 changed files with 818 additions and 818 deletions
+21 -21
View File
@@ -26,7 +26,7 @@ from functools import partial
import dbus
from dbus import PROPERTIES_IFACE
import gobject
from gi.repository import GObject
from telepathy.client import Channel
from telepathy.interfaces import CHANNEL, \
CHANNEL_INTERFACE_GROUP, \
@@ -47,7 +47,7 @@ CONN_INTERFACE_BUDDY_INFO = 'org.laptop.Telepathy.BuddyInfo'
_logger = logging.getLogger('sugar3.presence.activity')
class Activity(gobject.GObject):
class Activity(GObject.GObject):
"""UI interface for an Activity in the presence service
Activities in the presence service represent your and other user's
@@ -61,24 +61,24 @@ class Activity(gobject.GObject):
joined
"""
__gsignals__ = {
'buddy-joined': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([gobject.TYPE_PYOBJECT])),
'buddy-left': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([gobject.TYPE_PYOBJECT])),
'new-channel': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([gobject.TYPE_PYOBJECT])),
'joined': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT])),
'buddy-joined': (GObject.SignalFlags.RUN_FIRST, None,
([GObject.TYPE_PYOBJECT])),
'buddy-left': (GObject.SignalFlags.RUN_FIRST, None,
([GObject.TYPE_PYOBJECT])),
'new-channel': (GObject.SignalFlags.RUN_FIRST, None,
([GObject.TYPE_PYOBJECT])),
'joined': (GObject.SignalFlags.RUN_FIRST, None,
([GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT])),
}
__gproperties__ = {
'id': (str, None, None, None, gobject.PARAM_READABLE),
'name': (str, None, None, None, gobject.PARAM_READWRITE),
'tags': (str, None, None, None, gobject.PARAM_READWRITE),
'color': (str, None, None, None, gobject.PARAM_READWRITE),
'type': (str, None, None, None, gobject.PARAM_READABLE),
'private': (bool, None, None, True, gobject.PARAM_READWRITE),
'joined': (bool, None, None, False, gobject.PARAM_READABLE),
'id': (str, None, None, None, GObject.PARAM_READABLE),
'name': (str, None, None, None, GObject.PARAM_READWRITE),
'tags': (str, None, None, None, GObject.PARAM_READWRITE),
'color': (str, None, None, None, GObject.PARAM_READWRITE),
'type': (str, None, None, None, GObject.PARAM_READABLE),
'private': (bool, None, None, True, GObject.PARAM_READWRITE),
'joined': (bool, None, None, False, GObject.PARAM_READABLE),
}
def __init__(self, account_path, connection, room_handle=None,
@@ -89,7 +89,7 @@ class Activity(gobject.GObject):
if properties is None:
properties = {}
gobject.GObject.__init__(self)
GObject.GObject.__init__(self)
self._account_path = account_path
self.telepathy_conn = connection
@@ -469,14 +469,14 @@ class Activity(gobject.GObject):
self.telepathy_text_chan.Close()
class _BaseCommand(gobject.GObject):
class _BaseCommand(GObject.GObject):
__gsignals__ = {
'finished': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
'finished': (GObject.SignalFlags.RUN_FIRST, None,
([object])),
}
def __init__(self):
gobject.GObject.__init__(self)
GObject.GObject.__init__(self)
self.text_channel = None
self.text_channel_group_flags = None
+18 -18
View File
@@ -23,9 +23,9 @@ STABLE.
import logging
import gobject
from gi.repository import GObject
import dbus
import gconf
from gi.repository import GConf
from telepathy.interfaces import CONNECTION, \
CONNECTION_INTERFACE_ALIASING, \
CONNECTION_INTERFACE_CONTACTS
@@ -39,7 +39,7 @@ CONN_INTERFACE_BUDDY_INFO = 'org.laptop.Telepathy.BuddyInfo'
_logger = logging.getLogger('sugar3.presence.buddy')
class BaseBuddy(gobject.GObject):
class BaseBuddy(GObject.GObject):
"""UI interface for a Buddy in the presence service
Each buddy interface tracks a set of activities and properties
@@ -57,16 +57,16 @@ class BaseBuddy(gobject.GObject):
__gtype_name__ = 'PresenceBaseBuddy'
__gsignals__ = {
'joined-activity': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([gobject.TYPE_PYOBJECT])),
'left-activity': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([gobject.TYPE_PYOBJECT])),
'property-changed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([gobject.TYPE_PYOBJECT])),
'joined-activity': (GObject.SignalFlags.RUN_FIRST, None,
([GObject.TYPE_PYOBJECT])),
'left-activity': (GObject.SignalFlags.RUN_FIRST, None,
([GObject.TYPE_PYOBJECT])),
'property-changed': (GObject.SignalFlags.RUN_FIRST, None,
([GObject.TYPE_PYOBJECT])),
}
def __init__(self):
gobject.GObject.__init__(self)
GObject.GObject.__init__(self)
self._key = None
self._nick = None
@@ -82,7 +82,7 @@ class BaseBuddy(gobject.GObject):
def set_key(self, key):
self._key = key
key = gobject.property(type=str, getter=get_key, setter=set_key)
key = GObject.property(type=str, getter=get_key, setter=set_key)
def get_nick(self):
return self._nick
@@ -90,7 +90,7 @@ class BaseBuddy(gobject.GObject):
def set_nick(self, nick):
self._nick = nick
nick = gobject.property(type=str, getter=get_nick, setter=set_nick)
nick = GObject.property(type=str, getter=get_nick, setter=set_nick)
def get_color(self):
return self._color
@@ -98,7 +98,7 @@ class BaseBuddy(gobject.GObject):
def set_color(self, color):
self._color = color
color = gobject.property(type=str, getter=get_color, setter=set_color)
color = GObject.property(type=str, getter=get_color, setter=set_color)
def get_current_activity(self):
if self._current_activity is None:
@@ -108,7 +108,7 @@ class BaseBuddy(gobject.GObject):
return activity
return None
current_activity = gobject.property(type=object,
current_activity = GObject.property(type=object,
getter=get_current_activity)
def get_owner(self):
@@ -117,7 +117,7 @@ class BaseBuddy(gobject.GObject):
def set_owner(self, owner):
self._owner = owner
owner = gobject.property(type=bool, getter=get_owner, setter=set_owner,
owner = GObject.property(type=bool, getter=get_owner, setter=set_owner,
default=False)
def get_ip4_address(self):
@@ -126,7 +126,7 @@ class BaseBuddy(gobject.GObject):
def set_ip4_address(self, ip4_address):
self._ip4_address = ip4_address
ip4_address = gobject.property(type=str, getter=get_ip4_address,
ip4_address = GObject.property(type=str, getter=get_ip4_address,
setter=set_ip4_address)
def get_tags(self):
@@ -135,7 +135,7 @@ class BaseBuddy(gobject.GObject):
def set_tags(self, tags):
self._tags = tags
tags = gobject.property(type=str, getter=get_tags, setter=set_tags)
tags = GObject.property(type=str, getter=get_tags, setter=set_tags)
def object_path(self):
"""Retrieve our dbus object path"""
@@ -243,6 +243,6 @@ class Owner(BaseBuddy):
def __init__(self):
BaseBuddy.__init__(self)
client = gconf.client_get_default()
client = GConf.Client.get_default()
self.props.nick = client.get_string('/desktop/sugar/user/nick')
self.props.color = client.get_string('/desktop/sugar/user/color')
+6 -6
View File
@@ -22,7 +22,7 @@ STABLE.
import logging
import gobject
from gi.repository import GObject
import dbus
import dbus.exceptions
import dbus.glib
@@ -46,18 +46,18 @@ ACCOUNT_MANAGER_PATH = '/org/freedesktop/Telepathy/AccountManager'
CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties'
class PresenceService(gobject.GObject):
class PresenceService(GObject.GObject):
"""Provides simplified access to the Telepathy framework to activities"""
__gsignals__ = {
'activity-shared': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT,
gobject.TYPE_PYOBJECT])),
'activity-shared': (GObject.SignalFlags.RUN_FIRST, None,
([GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT,
GObject.TYPE_PYOBJECT])),
}
def __init__(self):
"""Initialise the service and attempt to connect to events
"""
gobject.GObject.__init__(self)
GObject.GObject.__init__(self)
self._activity_cache = None
self._buddy_cache = {}