services/presence/: Move internal_get_activity to TestPresenceService

This commit is contained in:
Simon McVittie 2007-05-24 14:52:20 +01:00
parent f7ba2aa1e2
commit 2abcd89c1f
2 changed files with 4 additions and 6 deletions

View File

@ -304,7 +304,7 @@ class PresenceService(ExportedGObject):
@dbus.service.method(_PRESENCE_INTERFACE, in_signature="s",
out_signature="o")
def GetActivityById(self, actid):
act = self.internal_get_activity(actid)
act = self._activities.get(actid, None)
if not act or not act.props.valid:
raise NotFoundError("The activity was not found.")
return act.object_path()
@ -419,11 +419,6 @@ class PresenceService(ExportedGObject):
if activity:
activity.set_properties(props)
def internal_get_activity(self, actid):
if not self._activities.has_key(actid):
return None
return self._activities[actid]
def main(test_num=0, randomize=False):
loop = gobject.MainLoop()

View File

@ -155,6 +155,9 @@ class TestPresenceService(PresenceService):
return TestOwner(self, self._bus_name, self._get_next_object_id(),
self.__test_num, self.__randomize)
def internal_get_activity(self, actid):
return self._activities.get(actid, None):
def _extract_public_key(keyfile):
try: