Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/browser
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2006-06-15 15:29:00 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2006-06-15 15:29:00 (GMT)
commit27b4f25fade95d829364f2f7b9b893e31ede232d (patch)
tree04755c0725ec687aed367f3b930a28b4e2088849 /sugar/browser
parentf0af49616ca0b51336407b3bfc9ceff677178b7b (diff)
Merge
Diffstat (limited to 'sugar/browser')
-rw-r--r--sugar/browser/BrowserActivity.py19
-rw-r--r--sugar/browser/BrowserShell.py2
2 files changed, 10 insertions, 11 deletions
diff --git a/sugar/browser/BrowserActivity.py b/sugar/browser/BrowserActivity.py
index b01a8a4..aa06dfb 100644
--- a/sugar/browser/BrowserActivity.py
+++ b/sugar/browser/BrowserActivity.py
@@ -1,25 +1,24 @@
-from xml.sax import saxutils
-
import dbus
import pygtk
pygtk.require('2.0')
import gtk
import geckoembed
+import urllib
from sugar.shell import activity
from sugar.browser import NotificationBar
from sugar.browser import NavigationToolbar
+_BROWSER_ACTIVITY_TYPE = "_web_browser_olpc._udp"
+
class BrowserActivity(activity.Activity):
SOLO = 1
FOLLOWING = 2
LEADING = 3
- def __init__(self, group, uri):
+ def __init__(self, uri):
activity.Activity.__init__(self)
-
self.uri = uri
- self._group = group
self._mode = BrowserActivity.SOLO
def _update_shared_location(self):
@@ -85,14 +84,14 @@ class BrowserActivity(activity.Activity):
self._setup_shared(self.uri)
def publish(self):
- print 'Publish %s' % self.activity_get_id()
+ print 'Publish %s' % self.get_id()
def get_embed(self):
return self.embed
def share(self):
- address = self.embed.get_address()
- self._model = self._group.get_store().create_model(address)
+ url = self.embed.get_address()
+ self._model = self._group.get_store().create_model(url)
self._model.set_value('owner', self._group.get_owner().get_nick_name())
self._update_shared_location()
self.set_mode(BrowserActivity.LEADING)
@@ -101,8 +100,8 @@ class BrowserActivity(activity.Activity):
proxy_obj = bus.get_object('com.redhat.Sugar.Chat', '/com/redhat/Sugar/Chat')
chat_shell = dbus.Interface(proxy_obj, 'com.redhat.Sugar.ChatShell')
- escaped_title = saxutils.escape(self.embed.get_title())
- escaped_address = saxutils.escape(address)
+ escaped_title = urllib.quote(self.embed.get_title())
+ escaped_url = urllib.quote(url)
chat_shell.send_text_message('<richtext><link href="' + escaped_address +
'">' + escaped_title + '</link></richtext>')
diff --git a/sugar/browser/BrowserShell.py b/sugar/browser/BrowserShell.py
index d9fda40..5e07327 100644
--- a/sugar/browser/BrowserShell.py
+++ b/sugar/browser/BrowserShell.py
@@ -31,6 +31,6 @@ class BrowserShell(dbus.service.Object):
@dbus.service.method('com.redhat.Sugar.BrowserShell')
def open_browser(self, uri):
- browser = BrowserActivity(None, uri)
+ browser = BrowserActivity(uri)
self.__browsers.append(browser)
browser.connect_to_shell()