qweboobcfg: display website of backend in description in any

This commit is contained in:
Romain Bignon 2010-08-20 09:19:21 +02:00
commit 31445de767
3 changed files with 9 additions and 2 deletions

View file

@ -26,8 +26,6 @@ __all__ = ['GazelleBrowser']
class GazelleBrowser(BaseBrowser):
DOMAIN = 'ssl.what.cd'
PROTOCOL = 'https'
PAGES = {'https?://%s/?(index.php)?': IndexPage,
'https?://%s/login.php': LoginPage,
'https?://%s/torrents.php.*': TorrentsPage,

View file

@ -67,6 +67,13 @@ class Backend(object):
def config(self):
return self.klass.CONFIG
@property
def website(self):
if self.klass.BROWSER and self.klass.BROWSER.DOMAIN:
return '%s://%s' % (self.klass.BROWSER.PROTOCOL, self.klass.BROWSER.DOMAIN)
else:
return None
@property
def icon_path(self):
if self.klass.ICON is None:

View file

@ -272,6 +272,7 @@ class BackendCfg(QDialog):
'<b>Version</b>: %s<br />'
'<b>Maintainer</b>: %s<br />'
'<b>License</b>: %s<br />'
'%s'
'<b>Description</b>: %s<br />'
'<b>Capabilities</b>: %s<br />'))
% ('<img src="mydata://logo.png" />' if backend.icon_path else '',
@ -279,6 +280,7 @@ class BackendCfg(QDialog):
backend.version,
backend.maintainer.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;'),
backend.license,
('<b>Website</b>: %s<br />' % backend.website) if backend.website else '',
backend.description,
', '.join([cap.__name__ for cap in backend.iter_caps()])))