Skip to content

Commit

Permalink
Fix extension to work with the new API in Epiphany 2.22 (thanks Thiba…
Browse files Browse the repository at this point in the history
…uld Nion

<tibonihoo@free.fr>).
  • Loading branch information
rossburton committed Apr 29, 2008
1 parent a9e2776 commit 4e592c8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions deliciouspost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4e592c8

Please sign in to comment.