Rework to not use protected API
This commit is contained in:
parent
167dbec0f5
commit
d919848324
@ -37,7 +37,8 @@ class ChatShellDbusService(dbus.service.Object):
|
|||||||
object_path = '/com/redhat/Sugar/Chat'
|
object_path = '/com/redhat/Sugar/Chat'
|
||||||
dbus.service.Object.__init__(self, bus_name, object_path)
|
dbus.service.Object.__init__(self, bus_name, object_path)
|
||||||
|
|
||||||
@dbus.service.method('com.redhat.Sugar.ChatShell')
|
@dbus.service.method('com.redhat.Sugar.ChatShell',
|
||||||
|
in_signature="o", out_signature="")
|
||||||
def open_chat(self, service_path):
|
def open_chat(self, service_path):
|
||||||
self._parent.open_chat_from_path(service_path)
|
self._parent.open_chat_from_path(service_path)
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ class ChatListener:
|
|||||||
return
|
return
|
||||||
|
|
||||||
def open_chat_from_path(self, service_path):
|
def open_chat_from_path(self, service_path):
|
||||||
service = self._pservice._new_object(service_path)
|
service = self._pservice.get(service_path)
|
||||||
self.open_chat(service)
|
self.open_chat(service)
|
||||||
|
|
||||||
def open_chat(self, service):
|
def open_chat(self, service):
|
||||||
|
@ -61,8 +61,8 @@ if os.path.isfile(os.path.join(basedir, 'sugar/__uninstalled__.py')):
|
|||||||
# FIXME delete the whole directory
|
# FIXME delete the whole directory
|
||||||
pass
|
pass
|
||||||
|
|
||||||
setup.install_activities(env.get_activities_dir(), activities_dest,
|
setup.setup_activities(env.get_activities_dir(), activities_dest,
|
||||||
os.path.join(basedir, 'shell/sugar-activity-factory'))
|
os.path.join(basedir, 'shell/sugar-activity-factory'))
|
||||||
else:
|
else:
|
||||||
print 'Running the installed sugar...'
|
print 'Running the installed sugar...'
|
||||||
from sugar import env
|
from sugar import env
|
||||||
|
@ -49,10 +49,11 @@ class ActivityFactory(dbus.service.Object):
|
|||||||
bus_name = dbus.service.BusName(factory, bus = bus)
|
bus_name = dbus.service.BusName(factory, bus = bus)
|
||||||
dbus.service.Object.__init__(self, bus_name, get_path(factory))
|
dbus.service.Object.__init__(self, bus_name, get_path(factory))
|
||||||
|
|
||||||
@dbus.service.method("com.redhat.Sugar.ActivityFactory")
|
@dbus.service.method("com.redhat.Sugar.ActivityFactory",
|
||||||
|
in_signature="o", out_signature="")
|
||||||
def create_with_service(self, service_path):
|
def create_with_service(self, service_path):
|
||||||
pservice = PresenceService()
|
pservice = PresenceService()
|
||||||
service = pservice._new_object(service_path)
|
service = pservice.get(service_path)
|
||||||
activity = self._class(service, [])
|
activity = self._class(service, [])
|
||||||
|
|
||||||
@dbus.service.method("com.redhat.Sugar.ActivityFactory")
|
@dbus.service.method("com.redhat.Sugar.ActivityFactory")
|
||||||
|
@ -125,6 +125,9 @@ class PresenceService(gobject.GObject):
|
|||||||
def _activity_disappeared_cb(self, object_path):
|
def _activity_disappeared_cb(self, object_path):
|
||||||
gobject.idle_add(self._emit_activity_disappeared_signal, object_path)
|
gobject.idle_add(self._emit_activity_disappeared_signal, object_path)
|
||||||
|
|
||||||
|
def get(self, object_path):
|
||||||
|
return self._new_object(object_path)
|
||||||
|
|
||||||
def get_services(self):
|
def get_services(self):
|
||||||
resp = self._ps.getServices()
|
resp = self._ps.getServices()
|
||||||
servs = []
|
servs = []
|
||||||
|
Loading…
Reference in New Issue
Block a user