Replace abstractproperty with abstractmethod (#3049)

This commit is contained in:
Joakim Sørensen 2021-08-05 15:28:32 +02:00 committed by GitHub
parent 9497f85db9
commit e7b5864c03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
"""Supervisor plugins base class.""" """Supervisor plugins base class."""
from abc import ABC, abstractmethod, abstractproperty from abc import ABC, abstractmethod
from typing import Optional from typing import Optional
from awesomeversion import AwesomeVersion, AwesomeVersionException from awesomeversion import AwesomeVersion, AwesomeVersionException
@ -37,7 +37,7 @@ class PluginBase(ABC, FileConfiguration, CoreSysAttributes):
self._data[ATTR_IMAGE] = value self._data[ATTR_IMAGE] = value
@property @property
@abstractproperty @abstractmethod
def latest_version(self) -> Optional[AwesomeVersion]: def latest_version(self) -> Optional[AwesomeVersion]:
"""Return latest version of the plugin.""" """Return latest version of the plugin."""

View File

@ -1,5 +1,5 @@
"""Baseclass for system checks.""" """Baseclass for system checks."""
from abc import ABC, abstractmethod, abstractproperty from abc import ABC, abstractmethod
import logging import logging
from typing import List, Optional from typing import List, Optional
@ -60,12 +60,12 @@ class CheckBase(ABC, CoreSysAttributes):
"""Approve check if it is affected by issue.""" """Approve check if it is affected by issue."""
@property @property
@abstractproperty @abstractmethod
def issue(self) -> IssueType: def issue(self) -> IssueType:
"""Return a IssueType enum.""" """Return a IssueType enum."""
@property @property
@abstractproperty @abstractmethod
def context(self) -> ContextType: def context(self) -> ContextType:
"""Return a ContextType enum.""" """Return a ContextType enum."""

View File

@ -1,5 +1,5 @@
"""Baseclass for system evaluations.""" """Baseclass for system evaluations."""
from abc import ABC, abstractmethod, abstractproperty from abc import ABC, abstractmethod
import logging import logging
from typing import List from typing import List
@ -39,7 +39,7 @@ class EvaluateBase(ABC, CoreSysAttributes):
"""Run evaluation.""" """Run evaluation."""
@property @property
@abstractproperty @abstractmethod
def reason(self) -> UnsupportedReason: def reason(self) -> UnsupportedReason:
"""Return a UnsupportedReason enum.""" """Return a UnsupportedReason enum."""
@ -49,7 +49,7 @@ class EvaluateBase(ABC, CoreSysAttributes):
return self.__class__.__module__.rsplit(".", maxsplit=1)[-1] return self.__class__.__module__.rsplit(".", maxsplit=1)[-1]
@property @property
@abstractproperty @abstractmethod
def on_failure(self) -> str: def on_failure(self) -> str:
"""Return a string that is printed when self.evaluate is False.""" """Return a string that is printed when self.evaluate is False."""

View File

@ -1,5 +1,5 @@
"""Baseclass for system fixup.""" """Baseclass for system fixup."""
from abc import ABC, abstractmethod, abstractproperty from abc import ABC, abstractmethod
import logging import logging
from typing import List, Optional from typing import List, Optional
@ -53,12 +53,12 @@ class FixupBase(ABC, CoreSysAttributes):
"""Run processing of fixup.""" """Run processing of fixup."""
@property @property
@abstractproperty @abstractmethod
def suggestion(self) -> SuggestionType: def suggestion(self) -> SuggestionType:
"""Return a SuggestionType enum.""" """Return a SuggestionType enum."""
@property @property
@abstractproperty @abstractmethod
def context(self) -> ContextType: def context(self) -> ContextType:
"""Return a ContextType enum.""" """Return a ContextType enum."""