use deluge.common version in webui
This commit is contained in:
parent
9307778bea
commit
de49037412
|
@ -13,9 +13,6 @@ http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
|
|||
__all__ = ["debugerror", "djangoerror"]
|
||||
|
||||
import utils
|
||||
print utils
|
||||
print dir(utils)
|
||||
|
||||
|
||||
pretty_errors_str = {
|
||||
"org.freedesktop.DBus.Error.ServiceUnknown":
|
||||
|
@ -43,6 +40,7 @@ from web import template
|
|||
import web #import lib.webpy022.webapi as web
|
||||
import webserver_common as ws
|
||||
from traceback import format_tb
|
||||
from deluge import common
|
||||
|
||||
Template = template.Template
|
||||
|
||||
|
@ -344,10 +342,8 @@ def djangoerror():
|
|||
from render import render
|
||||
return render.error(pretty_errors_cls[exception_type])
|
||||
|
||||
version_info = (
|
||||
"WebUi : rev." + ws.REVNO
|
||||
+ "Python : " + str(sys.version)
|
||||
)
|
||||
version_info = "WebUi : %sr%s\nPython %s:" % ( common.get_version() ,common.get_revision(),sys.version)
|
||||
|
||||
try:
|
||||
import dbus
|
||||
version_info += '\ndbus:' + str(dbus.__version__)
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
# statement from all source files in the program, then also delete it here.
|
||||
|
||||
#relative:
|
||||
from webserver_common import REVNO, VERSION
|
||||
|
||||
from utils import *
|
||||
import utils
|
||||
#/relative
|
||||
|
@ -191,8 +191,8 @@ template.Template.globals.update({
|
|||
'fsize': common.fsize,
|
||||
'ftime':ftime,
|
||||
'render': render, #for easy resuse of templates
|
||||
'rev': 'rev.%s' % (REVNO, ),
|
||||
'version': VERSION,
|
||||
'version':common.get_version() ,
|
||||
'rev': common.get_revision(),
|
||||
'getcookie':getcookie,
|
||||
'get': lambda (var): getattr(web.input(**{var:None}), var), # unreadable :-(
|
||||
#'env':'0.6',
|
||||
|
|
|
@ -2,7 +2,7 @@ $:render.header(_('About'), 'about')
|
|||
$:render.admin_toolbar('about')
|
||||
<div class="panel" style="text-align:left">
|
||||
<h2>Version</h2>
|
||||
<pre>$version </pre>
|
||||
<pre>$(version)r$rev</pre>
|
||||
|
||||
<h2>Template</h2>
|
||||
Name: $get_config('template')<br />
|
||||
|
|
|
@ -49,7 +49,7 @@ from deluge import component
|
|||
from deluge.log import LOG as log
|
||||
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
|
||||
|
||||
webui_plugin_manager = component.get("WebPluginManager")
|
||||
|
|
|
@ -34,15 +34,6 @@ webui constants
|
|||
"""
|
||||
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',
|
||||
'eta', 'ratio', 'file_progress', 'distributed_copies', 'total_done',
|
||||
|
|
Loading…
Reference in New Issue