mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
cosmetic: Minor yapf and other fixes
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
09583f3bbe
commit
d2993236e3
@ -180,8 +180,10 @@ class Component:
|
|||||||
|
|
||||||
def enable(self):
|
def enable(self):
|
||||||
"""Run operations to enable the component."""
|
"""Run operations to enable the component."""
|
||||||
|
|
||||||
def disable(self):
|
def disable(self):
|
||||||
"""Run operations to disable the component."""
|
"""Run operations to disable the component."""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def diagnose():
|
def diagnose():
|
||||||
"""Run diagnostics and return results.
|
"""Run diagnostics and return results.
|
||||||
@ -258,6 +260,7 @@ class LeaderComponent(Component):
|
|||||||
|
|
||||||
class Info(FollowerComponent):
|
class Info(FollowerComponent):
|
||||||
"""Component to capture basic information about an app."""
|
"""Component to capture basic information about an app."""
|
||||||
|
|
||||||
def __init__(self, app_id, version, is_essential=False, depends=None,
|
def __init__(self, app_id, version, is_essential=False, depends=None,
|
||||||
name=None, icon=None, icon_filename=None,
|
name=None, icon=None, icon_filename=None,
|
||||||
short_description=None, description=None, manual_page=None,
|
short_description=None, description=None, manual_page=None,
|
||||||
|
|||||||
@ -147,6 +147,7 @@ class GitwebApp(app_module.App):
|
|||||||
|
|
||||||
class GitwebWebserverAuth(Webserver):
|
class GitwebWebserverAuth(Webserver):
|
||||||
"""Component to handle Gitweb authentication webserver configuration."""
|
"""Component to handle Gitweb authentication webserver configuration."""
|
||||||
|
|
||||||
def is_conf_enabled(self):
|
def is_conf_enabled(self):
|
||||||
"""Check whether Gitweb authentication configuration is enabled."""
|
"""Check whether Gitweb authentication configuration is enabled."""
|
||||||
return super().is_enabled()
|
return super().is_enabled()
|
||||||
|
|||||||
@ -97,6 +97,7 @@ class RadicaleApp(app_module.App):
|
|||||||
|
|
||||||
class RadicaleWebserver(Webserver):
|
class RadicaleWebserver(Webserver):
|
||||||
"""Webserver enable/disable behavior specific for radicale."""
|
"""Webserver enable/disable behavior specific for radicale."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def web_name(self):
|
def web_name(self):
|
||||||
"""Return web configuration name based on radicale version."""
|
"""Return web configuration name based on radicale version."""
|
||||||
@ -113,6 +114,7 @@ class RadicaleWebserver(Webserver):
|
|||||||
|
|
||||||
class RadicaleUwsgi(Uwsgi):
|
class RadicaleUwsgi(Uwsgi):
|
||||||
"""uWSGI enable/disable behavior specific for radicale."""
|
"""uWSGI enable/disable behavior specific for radicale."""
|
||||||
|
|
||||||
def is_enabled(self):
|
def is_enabled(self):
|
||||||
"""Return whether the uWSGI configuration is enabled if version>=2."""
|
"""Return whether the uWSGI configuration is enabled if version>=2."""
|
||||||
package_version = get_package_version()
|
package_version = get_package_version()
|
||||||
@ -137,6 +139,7 @@ class RadicaleUwsgi(Uwsgi):
|
|||||||
|
|
||||||
class RadicaleDaemon(Daemon):
|
class RadicaleDaemon(Daemon):
|
||||||
"""Daemon enable/disable behavior specific for radicale."""
|
"""Daemon enable/disable behavior specific for radicale."""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _is_old_radicale():
|
def _is_old_radicale():
|
||||||
"""Return whether radicale is less than version 2."""
|
"""Return whether radicale is less than version 2."""
|
||||||
|
|||||||
@ -92,6 +92,7 @@ class SearxApp(app_module.App):
|
|||||||
|
|
||||||
class SearxWebserverAuth(Webserver):
|
class SearxWebserverAuth(Webserver):
|
||||||
"""Component to handle Searx authentication webserver configuration."""
|
"""Component to handle Searx authentication webserver configuration."""
|
||||||
|
|
||||||
def is_enabled(self):
|
def is_enabled(self):
|
||||||
"""Return if configuration is enabled or public access is enabled."""
|
"""Return if configuration is enabled or public access is enabled."""
|
||||||
return is_public_access_enabled() or super().is_enabled()
|
return is_public_access_enabled() or super().is_enabled()
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
plinth.modules.sharing
|
plinth.modules.sharing
|
||||||
|
|||||||
@ -25,7 +25,7 @@ from . import get_last_admin_user
|
|||||||
from .components import UsersAndGroups
|
from .components import UsersAndGroups
|
||||||
|
|
||||||
|
|
||||||
class ValidNewUsernameCheckMixin(object):
|
class ValidNewUsernameCheckMixin:
|
||||||
"""Mixin to check if a username is valid for created new user."""
|
"""Mixin to check if a username is valid for created new user."""
|
||||||
|
|
||||||
def clean_username(self):
|
def clean_username(self):
|
||||||
|
|||||||
@ -10,6 +10,7 @@ from django import urls
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.contrib.messages.storage.fallback import FallbackStorage
|
from django.contrib.messages.storage.fallback import FallbackStorage
|
||||||
from django.core.exceptions import PermissionDenied
|
from django.core.exceptions import PermissionDenied
|
||||||
|
|
||||||
from plinth import module_loader
|
from plinth import module_loader
|
||||||
from plinth.modules.users import views
|
from plinth.modules.users import views
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user