summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos Pinto <markybob@dipconsultants.com>2007-11-24 20:39:55 +0000
committerMarcos Pinto <markybob@dipconsultants.com>2007-11-24 20:39:55 +0000
commitee409d71c5c696b5f0b9bb059f35d66102dbe644 (patch)
tree31d443cec08e2cd786969df765d99f54af014e1f
parent9777d4e00cfa23c401e49348b0ff9a85513639e3 (diff)
downloaddeluge-ee409d71c5c696b5f0b9bb059f35d66102dbe644.tar.gz
deluge-ee409d71c5c696b5f0b9bb059f35d66102dbe644.tar.bz2
deluge-ee409d71c5c696b5f0b9bb059f35d66102dbe644.zip
fix add torrent in webui
-rw-r--r--plugins/WebUi/scripts/extract_template_strings.py15
-rw-r--r--plugins/WebUi/scripts/template_strings.py11
-rw-r--r--plugins/WebUi/webserver_framework.py4
3 files changed, 20 insertions, 10 deletions
diff --git a/plugins/WebUi/scripts/extract_template_strings.py b/plugins/WebUi/scripts/extract_template_strings.py
index c653ac095..b1a894b31 100644
--- a/plugins/WebUi/scripts/extract_template_strings.py
+++ b/plugins/WebUi/scripts/extract_template_strings.py
@@ -1,13 +1,18 @@
from __future__ import with_statement
import os
import re
-template_dir = '~/prj/WebUi/templates/deluge'
-template_dir = os.path.expanduser(template_dir )
+template_dirs = ['~/prj/WebUi/templates/deluge',
+ '~/prj/WebUi/templates/advanced']
+template_dirs = [os.path.expanduser(template_dir ) for template_dir in template_dirs]
+
+
+files = []
+for template_dir in template_dirs:
+ files += [os.path.join(template_dir,fname)
+ for fname in os.listdir(template_dir)
+ if fname.endswith('.html')]
-files = [os.path.join(template_dir,fname)
- for fname in os.listdir(template_dir)
- if fname.endswith('.html')]
all_strings = []
for filename in files:
diff --git a/plugins/WebUi/scripts/template_strings.py b/plugins/WebUi/scripts/template_strings.py
index 0c057c757..925db255d 100644
--- a/plugins/WebUi/scripts/template_strings.py
+++ b/plugins/WebUi/scripts/template_strings.py
@@ -1,5 +1,6 @@
_('# Of Files')
_('About')
+_('Add')
_('Add Torrent')
_('Add torrent')
_('Apply')
@@ -13,6 +14,7 @@ _('Delete .torrent file')
_('Delete downloaded files.')
_('Details')
_('Disable')
+_('Down')
_('Down Speed')
_('Download')
_('Downloaded')
@@ -27,19 +29,20 @@ _('Next Announce')
_('Off')
_('Password')
_('Password is invalid,try again')
+_('Pause')
_('Pause all')
_('Peers')
_('Pieces')
_('Progress')
_('Queue Down')
+_('Queue Position')
_('Queue Up')
-_('Queue pos:')
_('Ratio')
_('Reannounce')
_('Refresh page every:')
_('Remove')
-_('Remove %s ')
-_('Remove %s?')
+_('Remove torrent')
+_('Resume')
_('Resume all')
_('Seeders')
_('Set')
@@ -47,11 +50,13 @@ _('Set Timeout')
_('Share Ratio')
_('Size')
_('Speed')
+_('Start')
_('Submit')
_('Torrent list')
_('Total Size')
_('Tracker')
_('Tracker Status')
+_('Up')
_('Up Speed')
_('Upload')
_('Upload torrent')
diff --git a/plugins/WebUi/webserver_framework.py b/plugins/WebUi/webserver_framework.py
index 595ae2047..ab1755458 100644
--- a/plugins/WebUi/webserver_framework.py
+++ b/plugins/WebUi/webserver_framework.py
@@ -221,7 +221,7 @@ def get_torrent_status(torrent_id):
url = urlparse(status.tracker)
if hasattr(url,'hostname'):
- status.category = url.hostname
+ status.category = url.hostname or 'unknown'
else:
status.category = 'No-tracker'
@@ -265,7 +265,7 @@ def get_torrent_status(torrent_id):
return status
def get_categories(torrent_list):
- trackers = [torrent['category'] for torrent in torrent_list]
+ trackers = [(torrent['category'] or 'unknown') for torrent in torrent_list]
categories = {}
for tracker in trackers:
categories[tracker] = categories.get(tracker,0) + 1