Adding a recheck command to console UI?

Suggestions and discussion of future versions
Post Reply
anand

Adding a recheck command to console UI?

Post by anand »

I'm trying to adding a "recheck" command to the console UI. I just copied over pause.py from the path /usr/share/python-support/deluge-console/deluge/ui/console/commands and gave it the name recheck.py. Here are the changes I made:

Code: Select all

diff pause.py recheck.py
3c3
< # pause.py
---
> # recheck.py
43,44c43,44
<     """Pause a torrent"""
<     usage = "Usage: pause [ all | <torrent-id> [<torrent-id> ...] ]"
---
>     """Recheck a torrent"""
>     usage = "Usage: recheck [ all | <torrent-id> [<torrent-id> ...] ]"
54c54
<             client.pause_torrent(torrents)
---
>             client.force_recheck(torrents)
58c58
<             print templates.SUCCESS('torrent%s successfully paused' % ('s' if len(args) > 1 else ''))
---
>             print templates.SUCCESS('initiated recheck for torrent%s' % ('s' if len(args) > 1 else ''))
However, when I start the deluge console UI, "recheck" still gives me an "unknown command" error. I'm not really familiar with python but looking through the code, it looks like it dynamically builds the command list based on the contents of the "command" directory. Is there anything else I need to change to hook in this new "recheck" command?

I'm using 1.1.9+dfsg-2~intrepid~ppa1 from the Ubuntu PPA.
andar
Top Bloke
Top Bloke
Posts: 1050
Joined: Fri Jun 08, 2007 8:38 pm
Location: Victoria, BC
Contact:

Re: Adding a recheck command to console UI?

Post by andar »

My suggestion would be to download the source package, add your command into that source tree and then install it.
Post Reply