Jaime Frutos Morales's blog

28/07/2006

RAE’s dictionary handler for deskbar-applet

Filed under: GNOME, Python — acidborg @ 13:21

As I promised, I’ve written a handler for deskbar-applet (extensions are called handlers in deskbar-applet). It’s written in Python and it just took me a couple of hours.

It is very simple: you just type a word in deskbar-applet, then you choose to look it up in RAE’s dictionary and the definition appears on your favourite browser. RAE means “Real Academia Española de la lengua”, the maximum Spanish language authority.

It can be downloaded from here.

A couple of screenshots:

Rae handler1

Rae handler2

To install it:

  • Download it
  • Untar the downloaded file: tar xvfz rae.tar.gz
  • Copy it to your deskbar-applet handlers directory: cp rae.py $HOME/.gnome2/deskbar-applet/handlers
  • Restart deskbar-applet
  • Go to the “Preferences” menu and load the handler by clicking on the checkbox next to “RAE’s dictionary”
  • Start Looking up words

I have added bug #349075 to bugzilla as an enhancement with my handler and I’ve included it in the “Extending the DeskbarApplet” web.

25/07/2006

Creative Commons license viewer 0.2

Filed under: GNOME, Python — acidborg @ 02:15

I finally release the next version of my epiphany extension. Things fixed:

  • Installation bug fixed: No separate image file is needed!
  • Internationalization support

Looking for a solution to the image installation problem, I tried to check for its path and it worked. But then, I found a better solution looking at other extension: inline images. I think this idea is great! You just have to use gdk-pixbuf-csource –raw image.gif on the shell to generate the inline image, add it to a variable inside your code and call gtk.gdk.pixbuf_new_from_inline(data_length, data, copy_pixels) to load it.

Installation instructions:

      Download it.
      Write tar xvfz cc-license-viewer.tar.gz on the shell to extract it.
      Copy the extracted files to .gnome2/epiphany/extensions in your home directory.
      Open epiphany and load the extension using the Tools->Extensions menu.
      A “CC” icon will appear in the statusbar everytime you visit a website under a Creative Commons license.

I have mailed the Creative Commons staff to tell them about my extension and to ask if they can add it to their browser plugins site 😀 .

I’m planning to code a new extension, but this time for Deskbar-applet. News coming soon…

20/07/2006

Epiphany extension: Creative Commons license viewer

Filed under: GNOME, Python — acidborg @ 00:46

I have been learning Python for 2 weeks using this book:

Beginning Python

I have always loved C, but now I’m beginning to understand why people use Python nowadays. It is very easy to learn and it is thought to avoid a lot of common programming mistakes that appear using other programming languages. Development using Python is very fast and you can have a running GTK application in just a few hours.

After studying it, I wanted to try it on Gnome, so I read PyGtk documentation. I decided to start by coding an extension for Epiphany, the Gnome web browser. I decided to do it because it seems to be far more easy to code an extension than to create a new application for my first Python contact. Looking for ideas for my extension, I read the Google Summer of Code ideas. I have always liked the Creative Commons initiative, so I decided to code an extension that detects websites licensed under a Creative Commons license and shows an icon on the statusbar to notify the user. When the user click on that icon, a new tab is opened and shows the license to the user.

Here are some screenshots of the extension in action:

License detected:
cc-license-viewer1.png

Creative Commons license of the web:
cc-license-viewer2.png

The extension can be downloaded from here. You have to copy the file in $HOME/.gnome2/epiphany/extensions/ . Due to my lack of experience, there are some “hacky” things in the extension. You have to copy the gif file to your home directory to see the icon properly.

Enjoy it!

« Newer Posts

Blog at WordPress.com.