Adding a recheck command to console UI?
Posted: Wed Aug 05, 2009 8:03 pm
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:
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.
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 ''))
I'm using 1.1.9+dfsg-2~intrepid~ppa1 from the Ubuntu PPA.