mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
syncthing: yapf indentation
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
5ec7f49c8b
commit
8dcf570c76
@ -14,7 +14,6 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Plinth module to configure Syncthing.
|
Plinth module to configure Syncthing.
|
||||||
"""
|
"""
|
||||||
@ -31,7 +30,6 @@ from plinth.modules.users import register_group
|
|||||||
from plinth.utils import format_lazy
|
from plinth.utils import format_lazy
|
||||||
from .manifest import clients
|
from .manifest import clients
|
||||||
|
|
||||||
|
|
||||||
version = 1
|
version = 1
|
||||||
|
|
||||||
managed_services = ['syncthing']
|
managed_services = ['syncthing']
|
||||||
@ -70,22 +68,17 @@ service = None
|
|||||||
def init():
|
def init():
|
||||||
"""Intialize the module."""
|
"""Intialize the module."""
|
||||||
menu = main_menu.get('apps')
|
menu = main_menu.get('apps')
|
||||||
menu.add_urlname(name, 'glyphicon-refresh',
|
menu.add_urlname(name, 'glyphicon-refresh', 'syncthing:index',
|
||||||
'syncthing:index', short_description)
|
short_description)
|
||||||
register_group(group)
|
register_group(group)
|
||||||
|
|
||||||
global service
|
global service
|
||||||
setup_helper = globals()['setup_helper']
|
setup_helper = globals()['setup_helper']
|
||||||
if setup_helper.get_state() != 'needs-setup':
|
if setup_helper.get_state() != 'needs-setup':
|
||||||
service = service_module.Service(
|
service = service_module.Service(
|
||||||
managed_services[0],
|
managed_services[0], name, ports=['http', 'https'],
|
||||||
name,
|
is_external=True, is_enabled=is_enabled, enable=enable,
|
||||||
ports=['http', 'https'],
|
disable=disable, is_running=is_running)
|
||||||
is_external=True,
|
|
||||||
is_enabled=is_enabled,
|
|
||||||
enable=enable,
|
|
||||||
disable=disable,
|
|
||||||
is_running=is_running)
|
|
||||||
|
|
||||||
if is_enabled():
|
if is_enabled():
|
||||||
add_shortcut()
|
add_shortcut()
|
||||||
@ -98,22 +91,18 @@ def setup(helper, old_version=None):
|
|||||||
global service
|
global service
|
||||||
if service is None:
|
if service is None:
|
||||||
service = service_module.Service(
|
service = service_module.Service(
|
||||||
managed_services[0],
|
managed_services[0], name, ports=['http', 'https'],
|
||||||
name,
|
is_external=True, is_enabled=is_enabled, enable=enable,
|
||||||
ports=['http', 'https'],
|
disable=disable, is_running=is_running)
|
||||||
is_external=True,
|
|
||||||
is_enabled=is_enabled,
|
|
||||||
enable=enable,
|
|
||||||
disable=disable,
|
|
||||||
is_running=is_running)
|
|
||||||
helper.call('post', service.notify_enabled, None, True)
|
helper.call('post', service.notify_enabled, None, True)
|
||||||
helper.call('post', add_shortcut)
|
helper.call('post', add_shortcut)
|
||||||
|
|
||||||
|
|
||||||
def add_shortcut():
|
def add_shortcut():
|
||||||
"""Helper method to add a shortcut to the frontpage."""
|
"""Helper method to add a shortcut to the frontpage."""
|
||||||
frontpage.add_shortcut(
|
frontpage.add_shortcut('syncthing', name,
|
||||||
'syncthing', name, short_description=short_description, url='/syncthing/', login_required=True)
|
short_description=short_description,
|
||||||
|
url='/syncthing/', login_required=True)
|
||||||
|
|
||||||
|
|
||||||
def is_running():
|
def is_running():
|
||||||
@ -144,7 +133,7 @@ def diagnose():
|
|||||||
results = []
|
results = []
|
||||||
|
|
||||||
results.extend(
|
results.extend(
|
||||||
action_utils.diagnose_url_on_all(
|
action_utils.diagnose_url_on_all('https://{host}/syncthing/',
|
||||||
'https://{host}/syncthing/', check_certificate=False))
|
check_certificate=False))
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user