osbuild: improve monitor docstrings/signatures
This is a split out from the work around json progress in [1]. [1] https://github.com/osbuild/osbuild/compare/main...mvo5:osbuild:json-progress-mvo?expand=1
This commit is contained in:
parent
3b7471ab7c
commit
b3c6366135
1 changed files with 6 additions and 6 deletions
|
|
@ -56,10 +56,10 @@ class BaseMonitor(abc.ABC):
|
||||||
self.out = TextWriter(fd)
|
self.out = TextWriter(fd)
|
||||||
|
|
||||||
def begin(self, pipeline: osbuild.Pipeline):
|
def begin(self, pipeline: osbuild.Pipeline):
|
||||||
"""Called once at the beginning of a build"""
|
"""Called once at the beginning of a pipeline"""
|
||||||
|
|
||||||
def finish(self, result: Dict):
|
def finish(self, results: Dict):
|
||||||
"""Called at the very end of the build"""
|
"""Called at the very end of a pipeline"""
|
||||||
|
|
||||||
def stage(self, stage: osbuild.Stage):
|
def stage(self, stage: osbuild.Stage):
|
||||||
"""Called when a stage is being built"""
|
"""Called when a stage is being built"""
|
||||||
|
|
@ -68,7 +68,7 @@ class BaseMonitor(abc.ABC):
|
||||||
"""Called when an assembler is being built"""
|
"""Called when an assembler is being built"""
|
||||||
|
|
||||||
def result(self, result: osbuild.pipeline.BuildResult):
|
def result(self, result: osbuild.pipeline.BuildResult):
|
||||||
"""Called when a module is done with its result"""
|
"""Called when a module (stage/assembler) is done with its result"""
|
||||||
|
|
||||||
def log(self, message: str):
|
def log(self, message: str):
|
||||||
"""Called for all module log outputs"""
|
"""Called for all module log outputs"""
|
||||||
|
|
@ -79,11 +79,11 @@ class NullMonitor(BaseMonitor):
|
||||||
|
|
||||||
|
|
||||||
class LogMonitor(BaseMonitor):
|
class LogMonitor(BaseMonitor):
|
||||||
"""Monitor that follows show the log output of modules
|
"""Monitor that follows the log output of modules
|
||||||
|
|
||||||
This monitor will print a header with `name: id` followed
|
This monitor will print a header with `name: id` followed
|
||||||
by the options for each module as it is being built. The
|
by the options for each module as it is being built. The
|
||||||
full log messages of the modules will be print as soon as
|
full log messages of the modules will be printed as soon as
|
||||||
they become available.
|
they become available.
|
||||||
The constructor argument `fd` is a file descriptor, where
|
The constructor argument `fd` is a file descriptor, where
|
||||||
the log will get written to. If `fd` is a `TTY`, escape
|
the log will get written to. If `fd` is a `TTY`, escape
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue