Replace abc.abstractproperty with property and abc.abstractmethod

Replace abc.abstractproperty with property and abc.abstractmethod,
as abc.abstractproperty has been deprecated since python3.3[1]

[1]https://docs.python.org/3.8/whatsnew/3.3.html?highlight=deprecated#abc

Change-Id: I1bcecd99d8856c26621a5304d9f7f01f8f111918
This commit is contained in:
ljhuang 2022-08-03 16:21:36 +08:00
parent 3bb577e338
commit 56413aa3c5
4 changed files with 20 additions and 10 deletions

View File

@ -55,11 +55,13 @@ class Engine(object, metaclass=abc.ABCMeta):
"""The options that were passed to this engine on construction."""
return self._options
@abc.abstractproperty
@property
@abc.abstractmethod
def storage(self):
"""The storage unit for this engine."""
@abc.abstractproperty
@property
@abc.abstractmethod
def statistics(self):
"""A dictionary of runtime statistics this engine has gathered.

View File

@ -128,6 +128,7 @@ class Flow(object, metaclass=abc.ABCMeta):
provides.update(item.provides)
return frozenset(provides)
@abc.abstractproperty
@property
@abc.abstractmethod
def requires(self):
"""Set of *unsatisfied* symbol names required by the flow."""

View File

@ -142,11 +142,13 @@ class Job(object, metaclass=abc.ABCMeta):
book_data = {}
self._book_data = book_data
@abc.abstractproperty
@property
@abc.abstractmethod
def last_modified(self):
"""The datetime the job was last modified."""
@abc.abstractproperty
@property
@abc.abstractmethod
def created_on(self):
"""The datetime the job was created on."""
@ -155,11 +157,13 @@ class Job(object, metaclass=abc.ABCMeta):
"""The board this job was posted on or was created from."""
return self._board
@abc.abstractproperty
@property
@abc.abstractmethod
def state(self):
"""Access the current state of this job."""
@abc.abstractproperty
@property
@abc.abstractmethod
def priority(self):
"""The :py:class:`~.JobPriority` of this job."""
@ -397,7 +401,8 @@ class JobBoard(object, metaclass=abc.ABCMeta):
appear (if None then waits forever).
"""
@abc.abstractproperty
@property
@abc.abstractmethod
def job_count(self):
"""Returns how many jobs are on this jobboard.
@ -516,7 +521,8 @@ class JobBoard(object, metaclass=abc.ABCMeta):
:type entity: :py:class:`~taskflow.types.entity.Entity`
"""
@abc.abstractproperty
@property
@abc.abstractmethod
def connected(self):
"""Returns if this jobboard is connected."""

View File

@ -42,7 +42,8 @@ class Backend(object, metaclass=abc.ABCMeta):
class Connection(object, metaclass=abc.ABCMeta):
"""Base class for backend connections."""
@abc.abstractproperty
@property
@abc.abstractmethod
def backend(self):
"""Returns the backend this connection is associated with."""