Suggestion: Display Torrents on G15 LCD

Suggest, post, or discuss plugins for Deluge
Post Reply
kebinusan

Suggestion: Display Torrents on G15 LCD

Post by kebinusan »

Just wanted to post suggesting a plugin to use g15tools to display torrent progress on the LCD of a g15 keyboard. I know there is an script to use the web interface for utorrent to accomplish a similar feat

http://forum.utorrent.com/viewtopic.php?pid=227891
mvoncken
Developer
Developer
Posts: 225
Joined: Mon Sep 03, 2007 9:38 pm

Re: Suggestion: Display Torrents on G15 LCD

Post by mvoncken »

It should be pretty easy to do this, the script you linked is in python.
But i won't do it, because i don't own that keyboard.

Here is an example for getting the relevant data in 0.6:
http://dev.deluge-torrent.org/browser/b ... notepad.py

If someone wants to work on this I will be available for help and better examples (0.5 and 0.6)
dev: webui, core, labels | irc:vonck7 |
kebinusan

Re: Suggestion: Display Torrents on G15 LCD

Post by kebinusan »

Thanks I'll take a look at it
mvoncken
Developer
Developer
Posts: 225
Joined: Mon Sep 03, 2007 9:38 pm

Re: Suggestion: Display Torrents on G15 LCD

Post by mvoncken »

kebinusan wrote:Thanks I'll take a look at it
ok ;)

0.5 example:

Code: Select all

"""
example : using deluge 0.5 webui dbus-server
webui plugin must be enabled,
"""
import dbus

#setup
TORRENT_KEYS = ['distributed_copies', 'download_payload_rate',
    'eta', 'is_seed', 'name', 'next_announce',
    'num_files', 'num_peers', 'num_pieces', 'num_seeds', 'paused',
    'piece_length','progress', 'ratio', 'total_done', 'total_download',
    'total_payload_download', 'total_payload_upload', 'total_peers',
    'total_seeds', 'total_size', 'total_upload', 'total_wanted',
    'tracker_status', 'upload_payload_rate',
    'uploaded_memory','tracker','state','queue_pos','user_paused']

bus = dbus.SessionBus()
proxy = bus.get_object("org.deluge_torrent.dbusplugin"
, "/org/deluge_torrent/DelugeDbusPlugin")


#list all torrents
torrent_ids = proxy.get_session_state()
print torrent_ids
for id in torrent_ids:
	torrent = proxy.get_torrent_status(id,TORRENT_KEYS)
	print torrent
	print str(torrent["name"])
	
#global status:

from deluge.common import fsize,fspeed

stats =  {
    'download_rate':fspeed(proxy.get_download_rate()),
    'upload_rate':fspeed(proxy.get_upload_rate()),
    'max_download':proxy.get_config_value('max_download_speed_bps'),
    'max_upload':proxy.get_config_value('max_upload_speed_bps'),
    'num_connections':proxy.get_num_connections(),
    'max_num_connections':proxy.get_config_value('max_connections_global')
    }

print stats
print str(stats["download_rate"])
dev: webui, core, labels | irc:vonck7 |
Post Reply