Disk space/unrar help with coding it/feature req

Suggestions and discussion of future versions
mrbrdo
Member
Member
Posts: 37
Joined: Mon Jun 02, 2008 6:18 am

Disk space/unrar help with coding it/feature req

Post by mrbrdo »

These two things we know from torrentflux (at least the b4rt version).

1. Display somewhere the amount of diskspace left on the partition where the torrent default folder is.
2. Unrar option for torrents... It would be great for example if it would work for those scene releases, just detect the correct rar file (for example .part01.rar or .rar) and spawn a rar to unrar it - like on torrentflux. I would suggest disabling this option if more directories containing rar files are found... I guess it shouldn't be too hard to implement.
TBH i still use Torrentflux regulary just for these two things (especially to unrar stuff) - so this would be a great addition, and very useful for many i think ;)

I am willing to do these things but i need just a little info.. I need to know how/where to write a function that can be called from the webui html file (like index.html from the classic skin)... An example would be nice. (i never coded in Python but i've been programming in C++/Pascal/Java for about 10 years)
johnnyg
Top Bloke
Top Bloke
Posts: 1522
Joined: Sun Oct 28, 2007 4:00 am
Location: Sydney, Australia

Re: Disk space/unrar help with coding it/feature req

Post by johnnyg »

you would probably want to write a plugin (which would then show up on any ui): http://dev.deluge-torrent.org/wiki/Development/Plugin
andar
Top Bloke
Top Bloke
Posts: 1050
Joined: Fri Jun 08, 2007 8:38 pm
Location: Victoria, BC
Contact:

Re: Disk space/unrar help with coding it/feature req

Post by andar »

mrbrdo wrote:These two things we know from torrentflux (at least the b4rt version).

1. Display somewhere the amount of diskspace left on the partition where the torrent default folder is.
2. Unrar option for torrents... It would be great for example if it would work for those scene releases, just detect the correct rar file (for example .part01.rar or .rar) and spawn a rar to unrar it - like on torrentflux. I would suggest disabling this option if more directories containing rar files are found... I guess it shouldn't be too hard to implement.
TBH i still use Torrentflux regulary just for these two things (especially to unrar stuff) - so this would be a great addition, and very useful for many i think ;)

I am willing to do these things but i need just a little info.. I need to know how/where to write a function that can be called from the webui html file (like index.html from the classic skin)... An example would be nice. (i never coded in Python but i've been programming in C++/Pascal/Java for about 10 years)
I've thought about writing a 'Run command after' type plugin where you can specify a command to run after a torrent finishes downloading.
mrbrdo
Member
Member
Posts: 37
Joined: Mon Jun 02, 2008 6:18 am

Re: Disk space/unrar help with coding it/feature req

Post by mrbrdo »

is there any 'kinda' complete example out there for a plugin? would be cool, i've looked at the wiki before but could use some more docs/examples if there's any :)

EDIT: i looked more into the dev wiki, and i really think you guys need a bit more docu for the plugins if someone is to write one ^^ i'm having problems with just defining a function in the plugin which i can call from the template... (i want to write some 'dynamic' HTML somewhere in the template that's ALL)
andar
Top Bloke
Top Bloke
Posts: 1050
Joined: Fri Jun 08, 2007 8:38 pm
Location: Victoria, BC
Contact:

Re: Disk space/unrar help with coding it/feature req

Post by andar »

mrbrdo wrote:is there any 'kinda' complete example out there for a plugin? would be cool, i've looked at the wiki before but could use some more docs/examples if there's any :)

EDIT: i looked more into the dev wiki, and i really think you guys need a bit more docu for the plugins if someone is to write one ^^ i'm having problems with just defining a function in the plugin which i can call from the template... (i want to write some 'dynamic' HTML somewhere in the template that's ALL)
You could look at the blocklist plugin for some examples.. anything webui you'll need to talk to mvoncken about.
mvoncken
Developer
Developer
Posts: 225
Joined: Mon Sep 03, 2007 9:38 pm

Re: Disk space/unrar help with coding it/feature req

Post by mvoncken »

mrbrdo wrote:is there any 'kinda' complete example out there for a plugin? would be cool, i've looked at the wiki before but could use some more docs/examples if there's any :)

EDIT: i looked more into the dev wiki, and i really think you guys need a bit more docu for the plugins if someone is to write one ^^ i'm having problems with just defining a function in the plugin which i can call from the template... (i want to write some 'dynamic' HTML somewhere in the template that's ALL)
I added a wiki page :
http://dev.deluge-torrent.org/wiki/Deve ... i/Examples

It's really hard to create good docs. and i'm the only one writing in the wiki.
We did discuss opening up the wiki on irc, it's closed for the public because of spam problems.

+I would like to add an api for webui the status-bar in the future.
dev: webui, core, labels | irc:vonck7 |
mrbrdo
Member
Member
Posts: 37
Joined: Mon Jun 02, 2008 6:18 am

Re: Disk space/unrar help with coding it/feature req

Post by mrbrdo »

wow, you actually wrote the plugin.. thanks :) i took a look at the code and i understand what you did, if i'm right the template system uses a kind of xmlrpc thing to get the variables..
i guess that leaves me with just one other thing: is it possible to 'export' functions aswell? if there's even a case where that would be necessary.. just asking so i have the info at hand when i need it :)

i understand there's little time to write the doku, but it does get frustrating sometimes when you want to do something and you can't find anything on how to do it ;) a tute like the one you posted is very much appreciated, i guess the only thing that's missing is a little work on the reference (like the signals and alert, it's a little vague :roll: )

i'll try to do an unrar plugin when i have some spare time and if i'm up to it :)

EDIT:
i tried doing the modifications you mentioned, but i get no menu, and http://myip:.../df says "not found".
is it possible that what you wrote doesn't work in my version? i'm not using svn, but the RC version (http://download.deluge-torrent.org/sour ... .09.tar.gz). I was checking the label plugin and the file structure was a bit different than mine, and on your wiki (webui.py file with ours, but label has a webui/ui.py file instead). or i might have done something wrong. the plugin is loaded...
some relevant (imo) stuff from debug log if it helps:

Code: Select all

[DEBUG   ] 06:36:24 corepluginbase:43 Registering export function export_get_df as diskspace_get_df
[INFO    ] 06:36:24 pluginmanagerbase:118 Plugin diskSpace enabled..
(my plugin is named diskSpace but i did fix the code copied from wiki properly (i think)

thank you
mvoncken
Developer
Developer
Posts: 225
Joined: Mon Sep 03, 2007 9:38 pm

Re: Disk space/unrar help with coding it/feature req

Post by mvoncken »

There should be an error on the webui 1.0 console in about not being able to load the plugin.
Yep, try svn.

The label plugin is more complex and has more subdirectories, simple plugins don't need that degree of organization.
dev: webui, core, labels | irc:vonck7 |
mrbrdo
Member
Member
Posts: 37
Joined: Mon Jun 02, 2008 6:18 am

Re: Disk space/unrar help with coding it/feature req

Post by mrbrdo »

The thing is, i tried the svn a few days ago, and i had problems (ajax skin: couldn't add torrent, white skin: sometimes index out of bounds error on selecting a torrent).. do you think the problem is really related to deluge version? is it OK that there is no mention of df.html in the code? (it's always reffered to as /df only) - is the extension added automagicaly?
btw sorry to be so blunt, but what's the webui console :)

thanks
mvoncken
Developer
Developer
Posts: 225
Joined: Mon Sep 03, 2007 9:38 pm

Re: Disk space/unrar help with coding it/feature req

Post by mvoncken »

mrbrdo wrote:The thing is, i tried the svn a few days ago, and i had problems (ajax skin: couldn't add torrent, white skin: sometimes index out of bounds error on selecting a torrent).. do you think the problem is really related to deluge version? is it OK that there is no mention of df.html in the code?[/qoute]
(it's always reffered to as /df only) - is the extension added automagicaly?
btw sorry to be so blunt, but what's the webui console :)

thanks
This is the framework we use : http://webpy.org/
The template-directory is registered using : "api.render.register_template_path(template_dir)" <- a deluge specific thing.
In "class df_page()":
api.render.df <-- maps to template/df.html <--web.py/templetor

What i meant with the webui console is what the terminal prints out after running "deluge -u web"
dev: webui, core, labels | irc:vonck7 |
Post Reply