refactor(services): add default implementation to get_enabled
parent
708c5cbc98
commit
6f035dc0db
|
@ -126,11 +126,12 @@ class Service(ABC):
|
|||
"""
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
def is_enabled() -> bool:
|
||||
@classmethod
|
||||
def is_enabled(cls) -> bool:
|
||||
"""`True` if the service is enabled."""
|
||||
pass
|
||||
name = cls.get_id()
|
||||
with ReadUserData() as user_data:
|
||||
return user_data.get(name, {}).get("enable", False)
|
||||
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
|
|
Loading…
Reference in New Issue