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'
|
||||
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):
|
||||
self._parent.open_chat_from_path(service_path)
|
||||
|
||||
@ -75,7 +76,7 @@ class ChatListener:
|
||||
return
|
||||
|
||||
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)
|
||||
|
||||
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
|
||||
pass
|
||||
|
||||
setup.install_activities(env.get_activities_dir(), activities_dest,
|
||||
os.path.join(basedir, 'shell/sugar-activity-factory'))
|
||||
setup.setup_activities(env.get_activities_dir(), activities_dest,
|
||||
os.path.join(basedir, 'shell/sugar-activity-factory'))
|
||||
else:
|
||||
print 'Running the installed sugar...'
|
||||
from sugar import env
|
||||
|
@ -49,10 +49,11 @@ class ActivityFactory(dbus.service.Object):
|
||||
bus_name = dbus.service.BusName(factory, bus = bus)
|
||||
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):
|
||||
pservice = PresenceService()
|
||||
service = pservice._new_object(service_path)
|
||||
service = pservice.get(service_path)
|
||||
activity = self._class(service, [])
|
||||
|
||||
@dbus.service.method("com.redhat.Sugar.ActivityFactory")
|
||||
|
@ -125,6 +125,9 @@ class PresenceService(gobject.GObject):
|
||||
def _activity_disappeared_cb(self, 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):
|
||||
resp = self._ps.getServices()
|
||||
servs = []
|
||||
|
Loading…
Reference in New Issue
Block a user