re-enable webui plugins

This commit is contained in:
Martijn Voncken 2008-07-05 07:49:26 +00:00
parent 0e25062af7
commit 0acd13aaca
6 changed files with 29 additions and 16 deletions

View File

@ -50,6 +50,7 @@ import lib.newforms_plus as forms
from deluge.ui.client import aclient from deluge.ui.client import aclient
from deluge import component, pluginmanagerbase from deluge import component, pluginmanagerbase
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
from deluge.log import LOG as log
class TOOLBAR_FLAGS: class TOOLBAR_FLAGS:
generic = 0 generic = 0
@ -134,19 +135,30 @@ class PluginManager(pluginmanagerbase.PluginManagerBase,
def start(self): def start(self):
"""Start the plugin manager""" """Start the plugin manager"""
# Update the enabled_plugins from the core # Update the enabled_plugins from the core
log.debug("start pl-manager")
aclient.get_enabled_plugins(self._on_get_enabled_plugins) aclient.get_enabled_plugins(self._on_get_enabled_plugins)
aclient.force_call(block=True)
def stop(self): def stop(self):
# Disable the plugins # Disable the plugins
self.disable_plugins() self.disable_plugins()
def _on_get_enabled_plugins(self, enabled_plugins): def _on_get_enabled_plugins(self, enabled_plugins):
log.debug("Webui has these plugins enabled: %s", enabled_plugins)
self.config["enabled_plugins"] = enabled_plugins log.debug("..Webui has these plugins enabled: %s", enabled_plugins)
log.debug("abababab")
log.debug(self.config)
self.config.config["enabled_plugins"] = enabled_plugins
# Enable the plugins that are enabled in the config and core # Enable the plugins that are enabled in the config and core
log.debug(self.enable_plugins)
try:
self.enable_plugins() self.enable_plugins()
except Exception, e:
log.debug(e)
class ConfigPageManager(component.Component): class ConfigPageManager(component.Component):
def __init__(self): def __init__(self):

View File

@ -62,7 +62,7 @@ class NetworkPorts(config_forms.CfgForm ):
if (data['_port_to'] < data['_port_from']): if (data['_port_to'] < data['_port_from']):
raise forms.ValidationError('"Port from" must be greater than "Port to"') raise forms.ValidationError('"Port from" must be greater than "Port to"')
def extra_html(self): def post_html(self):
return """ return """
<ul> <ul>
<li>Active port:%(active_port)s </li> <li>Active port:%(active_port)s </li>

View File

@ -101,7 +101,10 @@ class Form(FilteredForm):
def validate(self, data): def validate(self, data):
pass pass
def extra_html(self): def pre_html(self):
return ''
def post_html(self):
return '' return ''

View File

@ -103,9 +103,9 @@ class index:
filter_dict = {} filter_dict = {}
for filter_name in ["state","tracker","keyword"]: for filter_name in ["state","tracker","keyword"]:
value = getattr(vars, filter_name) value = getattr(vars, filter_name)
if value and value <> "All": if value and value <> "All" and value <> "None":
filter_dict[filter_name] = value filter_dict[filter_name] = value
log.debug(filter_dict)
torrent_ids = proxy.organize_get_session_state(filter_dict) torrent_ids = proxy.organize_get_session_state(filter_dict)
organize_filters = Storage(proxy.organize_all_filter_items()) organize_filters = Storage(proxy.organize_all_filter_items())

View File

@ -21,6 +21,7 @@ $for group in groups:
<h2>$form.group / $form.title</h2> <h2>$form.group / $form.title</h2>
<div class="info">$form.info</div> <div class="info">$form.info</div>
<form method="POST"> <form method="POST">
$:form.pre_html()
<table id="config_table"> <table id="config_table">
$:form.as_table() $:form.as_table()
<tr> <tr>
@ -35,11 +36,7 @@ $if message:
$if error: $if error:
<div class="error">$error</div> <div class="error">$error</div>
<div> $:form.post_html()
$:form.extra_html()
</div>
</form> </form>

View File

@ -262,9 +262,10 @@ def apply_config():
#etc, mostly for apache: #etc, mostly for apache:
from render import render from render import render
try: try:
sclient.set_core_uri(config.get('daemon')) #sclient.set_core_uri(config.get('daemon'))
except: daemon_connect(config.get('daemon'))
print "error setting core uri:",config.get('daemon') except Exception,e:
log.debug("error setting core uri:%s:%s:%s" % (config.get('daemon'),e,e.message))
render.set_global('base', config.get('base')) render.set_global('base', config.get('base'))
render.apply_cfg() render.apply_cfg()