Skip to content

Commit

Permalink
PEP-8, don't except so much in GError
Browse files Browse the repository at this point in the history
  • Loading branch information
jdahlin@async.com.br committed Aug 29, 2006
1 parent 1dfeb43 commit 06caa18
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions deliciouspost.py
Expand Up @@ -18,19 +18,19 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

from urllib import quote
import os.path
import urllib

import pygtk; pygtk.require("2.0")
import gobject, gtk
import gobject
import gtk

import epiphany

def post_cb (action, window):
def post_cb(action, window):
embed = window.get_active_embed()

siteurl = quote(embed.get_location(toplevel=True))
sitetitle = 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 All @@ -51,12 +51,17 @@ def init_plugin():
# Add the icons we use to the theme. A nice little hack because I'm too
# lazy to install icons correctly at the moment.
filename = os.path.join(os.path.dirname(__file__), "delicious.png")

try:
f = gtk.IconFactory()
f.add('delicious', gtk.IconSet(gtk.gdk.pixbuf_new_from_file(filename)))
f.add_default()
pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
except gobject.GError, e:
print e
return

# Register stockicon
f = gtk.IconFactory()
f.add('delicious', gtk.IconSet(pixbuf))
f.add_default()

shell = epiphany.ephy_shell_get_default()
model = shell.get_toolbars_model(False)
Expand Down

0 comments on commit 06caa18

Please sign in to comment.