summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan van Berkom <tristan@codethink.co.uk>2020-12-09 18:23:57 +0900
committerTristan van Berkom <tristan@codethink.co.uk>2020-12-10 17:07:27 +0900
commitf9ac4815ebec826aa076bff5ffd45f7559a752c9 (patch)
tree022f56cd042a25efccde3518adeb99f933ae279b
parent270439458a2c34486d1907aec53844cd29bfe2d6 (diff)
downloadbuildstream-f9ac4815ebec826aa076bff5ffd45f7559a752c9.tar.gz
_state.py: Rename _Task -> Task
The Task object is not internal to the State object, it is clearly given to the frontend and passed around.
-rw-r--r--src/buildstream/_artifactelement.py4
-rw-r--r--src/buildstream/_state.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/buildstream/_artifactelement.py b/src/buildstream/_artifactelement.py
index 63bb904fd..94503c4df 100644
--- a/src/buildstream/_artifactelement.py
+++ b/src/buildstream/_artifactelement.py
@@ -32,7 +32,7 @@ from .node import Node
if TYPE_CHECKING:
from ._context import Context
- from ._state import _Task
+ from ._state import Task
# ArtifactElement()
@@ -81,7 +81,7 @@ class ArtifactElement(Element):
# (ArtifactElement): A newly created Element instance
#
@classmethod
- def new_from_artifact_name(cls, artifact_name: str, context: "Context", task: Optional["_Task"] = None):
+ def new_from_artifact_name(cls, artifact_name: str, context: "Context", task: Optional["Task"] = None):
# Initial lookup for already loaded artifact.
with suppress(KeyError):
diff --git a/src/buildstream/_state.py b/src/buildstream/_state.py
index 4a552b0b9..0233dd323 100644
--- a/src/buildstream/_state.py
+++ b/src/buildstream/_state.py
@@ -292,7 +292,7 @@ class State:
if not elapsed_offset:
elapsed_offset = self.elapsed_time()
- task = _Task(self, task_id, action_name, full_name, elapsed_offset)
+ task = Task(self, task_id, action_name, full_name, elapsed_offset)
self.tasks[task_id] = task
for cb in self._task_added_cbs:
@@ -381,7 +381,7 @@ class State:
self._session_start += offset
-# _Task
+# Task
#
# The state data stored for an individual task
#
@@ -394,7 +394,7 @@ class State:
# e.g. an element's name.
# elapsed_offset (timedelta): The time the task started, relative to
# buildstream's start time.
-class _Task:
+class Task:
def __init__(self, state, task_id, action_name, full_name, elapsed_offset):
self._state = state
self.id = task_id