mumble: 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 48da6862b9
commit cedec9b624
3 files changed
+16 -55

No files matched your search

+12 -4
View File
@@ -22,6 +22,7 @@ Plinth module to configure Mumble server
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(_('Voice Chat (Mumble)'), 'glyphicon-headphones',
'mumble:index', 50)
output = actions.run('mumble', ['get-enabled'])
enabled = (output.strip() == 'yes')
global service
service = service_module.Service(
'mumble-plinth', _('Mumble Voice Chat Server'),
is_external=True, enabled=enabled)
is_external=True, enabled=is_enabled())
def is_enabled():
"""Return whether the module is enabled."""
return action_utils.service_is_enabled('mumble-server')
def is_running():
"""Return whether the service is running."""
return action_utils.service_is_running('mumble-server')
+2 -8
View File
@@ -26,7 +26,6 @@ import logging
from .forms import MumbleForm
from plinth import actions
from plinth import action_utils
from plinth import package
from plinth.modules import mumble
@@ -63,13 +62,8 @@ def index(request):
def get_status():
"""Get the current settings from server."""
output = actions.run('mumble', ['get-enabled'])
enabled = (output.strip() == 'yes')
status = {'enabled': enabled,
'is_running': action_utils.service_is_running('mumble')}
return status
return {'enabled': mumble.is_enabled(),
'is_running': mumble.is_running()}
def _apply_changes(request, old_status, new_status):