use deluge.common version in webui

This commit is contained in:
Martijn Voncken 2008-07-11 18:41:28 +00:00
parent 9307778bea
commit de49037412
5 changed files with 8 additions and 21 deletions

View File

@ -13,9 +13,6 @@ http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
__all__ = ["debugerror", "djangoerror"] __all__ = ["debugerror", "djangoerror"]
import utils import utils
print utils
print dir(utils)
pretty_errors_str = { pretty_errors_str = {
"org.freedesktop.DBus.Error.ServiceUnknown": "org.freedesktop.DBus.Error.ServiceUnknown":
@ -43,6 +40,7 @@ from web import template
import web #import lib.webpy022.webapi as web import web #import lib.webpy022.webapi as web
import webserver_common as ws import webserver_common as ws
from traceback import format_tb from traceback import format_tb
from deluge import common
Template = template.Template Template = template.Template
@ -344,10 +342,8 @@ def djangoerror():
from render import render from render import render
return render.error(pretty_errors_cls[exception_type]) return render.error(pretty_errors_cls[exception_type])
version_info = ( version_info = "WebUi : %sr%s\nPython %s:" % ( common.get_version() ,common.get_revision(),sys.version)
"WebUi : rev." + ws.REVNO
+ "Python : " + str(sys.version)
)
try: try:
import dbus import dbus
version_info += '\ndbus:' + str(dbus.__version__) version_info += '\ndbus:' + str(dbus.__version__)

View File

@ -30,7 +30,7 @@
# statement from all source files in the program, then also delete it here. # statement from all source files in the program, then also delete it here.
#relative: #relative:
from webserver_common import REVNO, VERSION
from utils import * from utils import *
import utils import utils
#/relative #/relative
@ -191,8 +191,8 @@ template.Template.globals.update({
'fsize': common.fsize, 'fsize': common.fsize,
'ftime':ftime, 'ftime':ftime,
'render': render, #for easy resuse of templates 'render': render, #for easy resuse of templates
'rev': 'rev.%s' % (REVNO, ), 'version':common.get_version() ,
'version': VERSION, 'rev': common.get_revision(),
'getcookie':getcookie, 'getcookie':getcookie,
'get': lambda (var): getattr(web.input(**{var:None}), var), # unreadable :-( 'get': lambda (var): getattr(web.input(**{var:None}), var), # unreadable :-(
#'env':'0.6', #'env':'0.6',

View File

@ -2,7 +2,7 @@ $:render.header(_('About'), 'about')
$:render.admin_toolbar('about') $:render.admin_toolbar('about')
<div class="panel" style="text-align:left"> <div class="panel" style="text-align:left">
<h2>Version</h2> <h2>Version</h2>
<pre>$version </pre> <pre>$(version)r$rev</pre>
<h2>Template</h2> <h2>Template</h2>
Name: $get_config('template')<br /> Name: $get_config('template')<br />

View File

@ -49,7 +49,7 @@ from deluge import component
from deluge.log import LOG as log from deluge.log import LOG as log
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
from webserver_common import REVNO, VERSION, TORRENT_KEYS, CONFIG_DEFAULTS from webserver_common import TORRENT_KEYS, CONFIG_DEFAULTS
from deluge.ui.client import sclient, aclient from deluge.ui.client import sclient, aclient
webui_plugin_manager = component.get("WebPluginManager") webui_plugin_manager = component.get("WebPluginManager")

View File

@ -34,15 +34,6 @@ webui constants
""" """
import os import os
try:
REVNO = open(os.path.join(os.path.dirname(__file__),'revno')).read()
except:
REVNO = '<unknown:bzr-branch?>'
try:
VERSION = open(os.path.join(os.path.dirname(__file__),'version')).read()
except:
VERSION = '<unknown:bzr-branch?>'
TORRENT_KEYS = ['name', 'total_size', 'num_files', 'num_pieces', 'piece_length', TORRENT_KEYS = ['name', 'total_size', 'num_files', 'num_pieces', 'piece_length',
'eta', 'ratio', 'file_progress', 'distributed_copies', 'total_done', 'eta', 'ratio', 'file_progress', 'distributed_copies', 'total_done',