Skip to content

Commit 4c6752d

Browse files
committed
Move Inspector out of app.py
1 parent 8d32ba3 commit 4c6752d

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/buildstream/_frontend/app.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def __init__(self, main_options):
6666
self.logger = None # The LogLine object
6767
self.interactive = None # Whether we are running in interactive mode
6868
self.colors = None # Whether to use colors in logging
69-
self.inspector = None # If inspection is required
7069

7170
#
7271
# Private members
@@ -304,9 +303,6 @@ def initialized(self, *, session_name=None):
304303
#
305304
self.stream.set_project(self.project)
306305

307-
# Initialize the inspector
308-
self.inspector = Inspector(self.stream, self.project, self.context)
309-
310306
# Run the body of the session here, once everything is loaded
311307
try:
312308
yield

src/buildstream/_frontend/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from ..types import _CacheBuildTrees, _SchedulerErrorAction, _PipelineSelection, _HostMount, _Scope
2525
from .._remotespec import RemoteSpec, RemoteSpecPurpose
2626
from ..utils import UtilError
27+
from .inspect import Inspector
2728

2829

2930
##################################################################
@@ -592,7 +593,8 @@ def inspect(app, elements, deps):
592593
593594
"""
594595
with app.initialized():
595-
app.inspector.dump_to_stdout(elements, selection=deps)
596+
inspector = Inspector(app.stream, app.project, app.context)
597+
inspector.dump_to_stdout(elements, selection=deps)
596598

597599

598600
##################################################################

0 commit comments

Comments
 (0)