Help with Python+Glade

Suggest, post, or discuss plugins for Deluge
Post Reply
Posts: 25
Joined: Sat Jun 02, 2007 9:52 pm
Location: Lincoln, UK

Help with Python+Glade

Post by SatNav »

Hi, I've started making an RSS plugin for deluge, since for me that's the killer feature this program is missing. I'm also using the experience to learn python, so it might be slow going - but I'm fairly confident.

I intend it to be similar in look and feel to the RSS downloader in uTorrent, since I'm familiar with that one.

Anyway, I'm just working on setting up the interface atm, and I've run into a stumbling block. I've set up a dialog for adding and removing feeds from a list, modelling it quite closely on the 'Search' plugin. I've set up event handlers in the Glade interface, but for some reason they don't seem to be connecting to their associated functions in Here's what I've got:

Code: Select all = + "/")
self.name_entry = glade.get_widget("name_entry")		
self.url_entry = glade.get_widget("url_entry")
...{"add_clicked": self.add_clicked,
		"del_clicked": self.del_clicked,
		"row_clicked": self.row_clicked,
		feedtext_changed": self.feedtext_changed })
def add_clicked(self, args):
I type a little text into one of the entry boxes, then press add (hoping to see the text disappear), but nothing happens. I've attached the py and glade files for a better picture of what I'm talking about. Any help appreciated :D

(2.36 KiB) Downloaded 246 times

Re: Help with Python+Glade

Post by loutr »


I think your problem is that you commented out the text_changed code, but left the function declaration, so python expects an indented block of code but instead finds another declaration. I haven't tested your code in deluge, but I guess deluge catches python errors triggered by plugins, so your code fails silently.
New User
New User
Posts: 3
Joined: Sat Jun 09, 2007 8:19 pm

Re: Help with Python+Glade

Post by orra »


loutr was partly right. You've got functions which are entirely commented out, and so Python errors which it finds the next function. More "pass"es are necessary.

Also, it errors without the icon, so you'll have to comment out that line, or add an icon.

And finally: in the top function, you need to change four instances of:

Doing all that got the add button working for me.

Here's a tip: run Deluge from the terminal. That way you'll see all the error messages.

Post Reply