s/publish/share

This commit is contained in:
Dan Williams 2006-07-25 17:17:05 -05:00
parent 8d232ae292
commit e5065263a9
5 changed files with 18 additions and 18 deletions

View File

@ -105,11 +105,11 @@ class BrowserActivity(Activity):
def get_embed(self): def get_embed(self):
return self.embed return self.embed
def publish(self): def share(self):
escaped_title = xml.sax.saxutils.escape(self.embed.get_title()) escaped_title = xml.sax.saxutils.escape(self.embed.get_title())
escaped_url = xml.sax.saxutils.escape(self.embed.get_address()) escaped_url = xml.sax.saxutils.escape(self.embed.get_address())
# Publish ourselves on the network # Share this activity with others
properties = {_SERVICE_URI_TAG: escaped_url, _SERVICE_TITLE_TAG: escaped_title} properties = {_SERVICE_URI_TAG: escaped_url, _SERVICE_TITLE_TAG: escaped_title}
self._share_service = self._pservice.share_activity(self, self._share_service = self._pservice.share_activity(self,
stype=self._default_type, properties=properties) stype=self._default_type, properties=properties)

View File

@ -20,8 +20,8 @@ class ActivityHost:
def get_id(self): def get_id(self):
return self._id return self._id
def publish(self): def share(self):
self._activity.publish() self._activity.share()
def get_shared(self): def get_shared(self):
return self._activity.get_shared() return self._activity.get_shared()

View File

@ -103,7 +103,7 @@ class PresenceView(gtk.VBox):
button_box.show() button_box.show()
def _share_button_clicked_cb(self, button): def _share_button_clicked_cb(self, button):
self._activity.publish() self._activity.share()
def _on_buddyList_buddy_selected(self, view, *args): def _on_buddyList_buddy_selected(self, view, *args):
(model, aniter) = view.get_selection().get_selected() (model, aniter) = view.get_selection().get_selected()

View File

@ -13,7 +13,7 @@ import sugar.util
ACTIVITY_SERVICE_NAME = "com.redhat.Sugar.Activity" ACTIVITY_SERVICE_NAME = "com.redhat.Sugar.Activity"
ACTIVITY_SERVICE_PATH = "/com/redhat/Sugar/Activity" ACTIVITY_SERVICE_PATH = "/com/redhat/Sugar/Activity"
ON_PUBLISH_CB = "publish" ON_SHARE_CB = "share"
def get_path(activity_name): def get_path(activity_name):
"""Returns the activity path""" """Returns the activity path"""
@ -87,7 +87,7 @@ class ActivityDbusService(dbus.service.Object):
The dbus service is separate from the actual Activity object so that we can The dbus service is separate from the actual Activity object so that we can
tightly control what stuff passes through the dbus python bindings.""" tightly control what stuff passes through the dbus python bindings."""
_ALLOWED_CALLBACKS = [ON_PUBLISH_CB] _ALLOWED_CALLBACKS = [ON_SHARE_CB]
def __init__(self, xid, activity): def __init__(self, xid, activity):
self._activity = activity self._activity = activity
@ -119,9 +119,9 @@ class ActivityDbusService(dbus.service.Object):
gobject.idle_add(self._call_callback_cb, self._callbacks[name], *args) gobject.idle_add(self._call_callback_cb, self._callbacks[name], *args)
@dbus.service.method(ACTIVITY_SERVICE_NAME) @dbus.service.method(ACTIVITY_SERVICE_NAME)
def publish(self): def share(self):
"""Called by the shell to request the activity to publish itself on the network.""" """Called by the shell to request the activity to share itself on the network."""
self._call_callback(ON_PUBLISH_CB) self._call_callback(ON_SHARE_CB)
@dbus.service.method(ACTIVITY_SERVICE_NAME) @dbus.service.method(ACTIVITY_SERVICE_NAME)
def get_id(self): def get_id(self):
@ -170,7 +170,7 @@ class Activity(gtk.Window):
def _register_service(self): def _register_service(self):
self._dbus_service = self._get_new_dbus_service() self._dbus_service = self._get_new_dbus_service()
self._dbus_service.register_callback(ON_PUBLISH_CB, self._internal_on_publish_cb) self._dbus_service.register_callback(ON_SHARE_CB, self._internal_on_share_cb)
def _cleanup(self): def _cleanup(self):
if self._dbus_service: if self._dbus_service:
@ -204,9 +204,9 @@ class Activity(gtk.Window):
"""Return whether or not this Activity is visible to the user.""" """Return whether or not this Activity is visible to the user."""
return self._has_focus return self._has_focus
def _internal_on_publish_cb(self): def _internal_on_share_cb(self):
"""Callback when the dbus service object tells us the user has closed our activity.""" """Callback when the dbus service object tells us the user has shared our activity."""
self.publish() self.share()
def get_id(self): def get_id(self):
return self._activity_id return self._activity_id
@ -215,6 +215,6 @@ class Activity(gtk.Window):
# Pure Virtual methods that subclasses may/may not implement # Pure Virtual methods that subclasses may/may not implement
############################################################# #############################################################
def publish(self): def share(self):
"""Called to request the activity to publish itself on the network.""" """Called to request the activity to share itself on the network."""
pass pass

View File

@ -38,8 +38,8 @@ class ActivityChat(GroupChat):
address=addr, port=port) address=addr, port=port)
self._setup_stream(self._chat_service) self._setup_stream(self._chat_service)
def publish(self): def share(self):
"""Only called when we publish the activity this chat is tied to.""" """Only called when we share the activity this chat is tied to."""
self._chat_service = self._pservice.share_activity(self._activity, self._chat_service = self._pservice.share_activity(self._activity,
stype=ActivityChat.SERVICE_TYPE) stype=ActivityChat.SERVICE_TYPE)
self._setup_stream(self._chat_service) self._setup_stream(self._chat_service)