mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
mumble: Remove get-enabled from actions
This commit is contained in:
1 parent
48da6862b9
commit
cedec9b624
3 files changed
+16
-55
No files matched your search
@@ -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')
|
||||
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user