privoxy: Remove get-enabled from actions

This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2015-07-19 19:56:05 -04:00
1 parent cedec9b624
commit 4906384b39
3 files changed
+14 -18

No files matched your search

+12 -4
View File
@@ -22,6 +22,7 @@ Plinth module to configure Privoxy.
from gettext import gettext as _
from plinth import actions
from plinth import action_utils
from plinth import cfg
from plinth import service as service_module
@@ -37,10 +38,17 @@ def init():
menu.add_urlname(_('Web Proxy (Privoxy)'), 'glyphicon-cloud-upload',
'privoxy:index', 50)
output = actions.run('privoxy', ['get-enabled'])
enabled = (output.strip() == 'yes')
global service
service = service_module.Service(
'privoxy', _('Privoxy Web Proxy'),
is_external=False, enabled=enabled)
is_external=False, enabled=is_enabled())
def is_enabled():
"""Return whether the module is enabled."""
return action_utils.service_is_enabled('privoxy')
def is_running():
"""Return whether the service is running."""
return action_utils.service_is_running('privoxy')
+2 -6
View File
@@ -26,7 +26,6 @@ import logging
from .forms import PrivoxyForm
from plinth import actions
from plinth import action_utils
from plinth import package
from plinth.modules import privoxy
@@ -63,11 +62,8 @@ def index(request):
def get_status():
"""Get the current settings from server."""
output = actions.run('privoxy', ['get-enabled'])
enabled = (output.strip() == 'yes')
status = {'enabled': enabled,
'is_running': action_utils.service_is_running('privoxy')}
status = {'enabled': privoxy.is_enabled(),
'is_running': privoxy.is_running()}
return status