Permalink
Browse files

Fix extension to work with the new API in Epiphany 2.22 (thanks Thiba…

…uld Nion

<tibonihoo@free.fr>).
  • Loading branch information...
rossburton committed Apr 29, 2008
1 parent a9e2776 commit 4e592c8461b8d60dc294d692212cf9a84474898a
Showing with 7 additions and 3 deletions.
  1. +7 −3 deliciouspost.py
View
@@ -62,10 +62,14 @@ def _find_group(self, window):
raise AssertionError("Cannot find SpecialToolbarActions group")
def _delicious_post_activate_cb(self, action, window):
- embed = window.get_active_embed()
-
+ try:
+ embed = window.get_active_child()
+ sitetitle = urllib.quote(embed.get_properties("title")[0])
+ except:
+ # Fallback on previous api (pre 2.22)
+ embed = window.get_active_embed()
+ sitetitle = urllib.quote(embed.get_title())
siteurl = urllib.quote(embed.get_location(toplevel=True))
- sitetitle = urllib.quote(embed.get_title())
url = "http://del.icio.us/post?v=4;url=%s;title=%s" % (siteurl, sitetitle)
embed.load_url(url)

0 comments on commit 4e592c8

Please sign in to comment.