Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2013-05-10 23:17:30 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2013-06-10 13:46:54 (GMT)
commit28fe9b757ffbcd3e29ed2bac131a232b6df90ea1 (patch)
tree4e340b8dadf699da99b9f62635fba5ee4460c485
parenta30af509c28d7241fc89fb10484f0063f156fc67 (diff)
Use a relative path in the activities url
It's just a bit cleaner.
-rw-r--r--src/sugar3/activity/htmlactivity.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sugar3/activity/htmlactivity.py b/src/sugar3/activity/htmlactivity.py
index 485b83b..f54f20a 100644
--- a/src/sugar3/activity/htmlactivity.py
+++ b/src/sugar3/activity/htmlactivity.py
@@ -21,9 +21,10 @@ from gi.repository import Gdk
from gi.repository import Gio
from gi.repository import WebKit2
from gi.repository import Gtk
+from gi.repository import GdkX11
+assert GdkX11
from gi.repository import SugarExt
-from sugar3.activity import activity
class HTMLActivity(Gtk.Window):
@@ -52,8 +53,7 @@ class HTMLActivity(Gtk.Window):
settings = self._web_view.get_settings()
settings.set_property("enable-developer-extras", True)
- self._web_view.load_uri("activity://%s/%s/index.html" %
- (self._bundle_id, self._bundle_path))
+ self._web_view.load_uri("activity://%s/index.html" % self._bundle_id)
def run_main_loop(self):
Gtk.main()
@@ -90,7 +90,8 @@ class HTMLActivity(Gtk.Window):
inspector.show()
def _app_scheme_cb(self, request, user_data):
- path = os.path.join(activity.get_bundle_path(), request.get_path())
+ path = os.path.join(self._bundle_path,
+ os.path.relpath(request.get_path(), "/"))
request.finish(Gio.File.new_for_path(path).read(None),
-1, Gio.content_type_guess(path, None)[0])