mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
torrent_info:display torrent files
This commit is contained in:
parent
75663de03c
commit
991a413327
6 changed files with 27 additions and 6 deletions
|
@ -89,6 +89,15 @@ def template_crop(text, end):
|
||||||
return "[ERROR NOT A STRING:(%s)]" % text
|
return "[ERROR NOT A STRING:(%s)]" % text
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
def template_crop_right(text, maxlen):
|
||||||
|
try:
|
||||||
|
if len(text) > maxlen:
|
||||||
|
return "..." + text[-(maxlen + 3):]
|
||||||
|
except:
|
||||||
|
return "[ERROR NOT A STRING:(%s)]" % text
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
def template_sort_head(id,name):
|
def template_sort_head(id,name):
|
||||||
#got tired of doing these complex things inside templetor..
|
#got tired of doing these complex things inside templetor..
|
||||||
vars = web.input(sort = None, order = None)
|
vars = web.input(sort = None, order = None)
|
||||||
|
@ -136,6 +145,7 @@ template.Template.globals.update({
|
||||||
'part_stats':template_part_stats,
|
'part_stats':template_part_stats,
|
||||||
'category_tabs':category_tabs,
|
'category_tabs':category_tabs,
|
||||||
'crop': template_crop,
|
'crop': template_crop,
|
||||||
|
'crop_right': template_crop_right,
|
||||||
'_': _ , #gettext/translations
|
'_': _ , #gettext/translations
|
||||||
'str': str, #because % in templetor is broken.
|
'str': str, #because % in templetor is broken.
|
||||||
'int':int,
|
'int':int,
|
||||||
|
|
|
@ -86,6 +86,14 @@ tr.altrow1{
|
||||||
background-color: #37506f;
|
background-color: #37506f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tr.tab_altrow0{
|
||||||
|
background-color: #304663;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.tab_altrow1{
|
||||||
|
background-color: #37506f;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tr.torrent_table_selected {
|
tr.torrent_table_selected {
|
||||||
|
|
|
@ -2,8 +2,8 @@ $def with (torrent)
|
||||||
|
|
||||||
$:(render.header(torrent.message + '/' + torrent.name))
|
$:(render.header(torrent.message + '/' + torrent.name))
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<h3>$_('Details')</h3>
|
|
||||||
|
|
||||||
|
<h3>$_('Details')</h3>
|
||||||
$:render.tab_meta(torrent)
|
$:render.tab_meta(torrent)
|
||||||
|
|
||||||
$if (torrent.action == 'start'):
|
$if (torrent.action == 'start'):
|
||||||
|
@ -18,6 +18,9 @@ $:render.part_button('POST', '/torrent/reannounce/' + str(torrent.id), _('Reanno
|
||||||
$:render.part_button('POST', '/torrent/queue/up/' + str(torrent.id), _('Queue Up'), 'tango/queue-up.png')
|
$:render.part_button('POST', '/torrent/queue/up/' + str(torrent.id), _('Queue Up'), 'tango/queue-up.png')
|
||||||
$:render.part_button('POST', '/torrent/queue/down/' + str(torrent.id), _('Queue Down'), 'tango/queue-down.png')
|
$:render.part_button('POST', '/torrent/queue/down/' + str(torrent.id), _('Queue Down'), 'tango/queue-down.png')
|
||||||
|
|
||||||
|
<br>
|
||||||
|
$:render.tab_files(torrent)
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<!--
|
<!--
|
||||||
[<a onclick="javascript:toggle_dump()">$_('Debug:Data Dump')</a>]
|
[<a onclick="javascript:toggle_dump()">$_('Debug:Data Dump')</a>]
|
||||||
|
|
|
@ -68,12 +68,12 @@ start = time.time()
|
||||||
torrent_ids = ws.proxy.get_session_state() #Syc-api.
|
torrent_ids = ws.proxy.get_session_state() #Syc-api.
|
||||||
torrent_dict = {}
|
torrent_dict = {}
|
||||||
for id in torrent_ids:
|
for id in torrent_ids:
|
||||||
async_proxy.get_torrent_status(dict_cb(id,torrent_dict), id, ["name"])
|
async_proxy.get_torrent_status(dict_cb(id,torrent_dict), id, [])
|
||||||
async_proxy.force_call(block=True)
|
async_proxy.force_call(block=True)
|
||||||
|
|
||||||
print "Async-list:",time.time() - start
|
print "Async-list:",time.time() - start
|
||||||
print torrent_dict[torrent_ids[0]].keys()
|
print "\n".join(torrent_dict[torrent_ids[0]].keys())
|
||||||
print torrent_dict[torrent_ids[0]]["name"]
|
print torrent_dict[torrent_ids[0]]["files"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,7 @@ def get_torrent_status(torrent_id):
|
||||||
helper method.
|
helper method.
|
||||||
enhance ws.proxy.get_torrent_status with some extra data
|
enhance ws.proxy.get_torrent_status with some extra data
|
||||||
"""
|
"""
|
||||||
status = ws.proxy.get_torrent_status(torrent_id,[])
|
status = ws.proxy.get_torrent_status(torrent_id,TORRENT_KEYS)
|
||||||
|
|
||||||
return enhance_torrent_status(torrent_id, status)
|
return enhance_torrent_status(torrent_id, status)
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ TORRENT_KEYS = ['distributed_copies', 'download_payload_rate',
|
||||||
'total_payload_download', 'total_payload_upload', 'total_peers',
|
'total_payload_download', 'total_payload_upload', 'total_peers',
|
||||||
'total_seeds', 'total_size', 'total_upload', 'total_wanted',
|
'total_seeds', 'total_size', 'total_upload', 'total_wanted',
|
||||||
'tracker_status', 'upload_payload_rate',
|
'tracker_status', 'upload_payload_rate',
|
||||||
'uploaded_memory','tracker','state','queue_pos','user_paused']
|
'uploaded_memory','tracker','state','queue_pos','user_paused','files']
|
||||||
|
|
||||||
STATE_MESSAGES = (_("Queued"),
|
STATE_MESSAGES = (_("Queued"),
|
||||||
_("Checking"),
|
_("Checking"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue