summaryrefslogtreecommitdiff
path: root/buildstream/_frontend
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-03 14:11:13 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-03 22:49:11 +0900
commitaf34d7169ecc45240be90ca99764474d9d2564ba (patch)
tree3901ed896bfe97eba131d0d89e4ed9edad5b24ee /buildstream/_frontend
parent01db40724a6ff0e69bdde02f5720479b1b503b3b (diff)
downloadbuildstream-af34d7169ecc45240be90ca99764474d9d2564ba.tar.gz
_project.py: Adhere to policy on private symbols
And adjust all surrounding sources for changed symbols. Additional details: o Added Project.get_shell_config() to report the shell configuration, instead of making those members all public o Moved assertions about project specified format versions required of plugins out of Plugin.__init__, and into Project.create_element() and Project.create_source(), so we can keep more things private This is a part of issue #285
Diffstat (limited to 'buildstream/_frontend')
-rw-r--r--buildstream/_frontend/app.py14
-rw-r--r--buildstream/_frontend/cli.py2
-rw-r--r--buildstream/_frontend/widget.py6
3 files changed, 11 insertions, 11 deletions
diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py
index ffe12d1db..17caf2db6 100644
--- a/buildstream/_frontend/app.py
+++ b/buildstream/_frontend/app.py
@@ -327,7 +327,7 @@ class App():
raise AppError("The given element has no sources", detail=detail)
# Check for workspace config
- if self.project._workspaces.get_workspace(target):
+ if self.project.workspaces.get_workspace(target):
raise AppError("Workspace '{}' is already defined.".format(target.name))
# If we're going to checkout, we need at least a fetch,
@@ -346,7 +346,7 @@ class App():
except OSError as e:
raise AppError("Failed to create workspace directory: {}".format(e)) from e
- workspace = self.project._workspaces.create_workspace(target, workdir)
+ workspace = self.project.workspaces.create_workspace(target, workdir)
if not no_checkout:
if not force and os.listdir(directory):
@@ -355,7 +355,7 @@ class App():
with target.timed_activity("Staging sources to {}".format(directory)):
workspace.open()
- self.project._workspaces.save_config()
+ self.project.workspaces.save_config()
self.message(MessageType.INFO, "Saved workspace configuration")
# close_workspace
@@ -368,7 +368,7 @@ class App():
#
def close_workspace(self, element_name, remove_dir):
- workspace = self.project._workspaces.get_workspace(element_name)
+ workspace = self.project.workspaces.get_workspace(element_name)
if workspace is None:
raise AppError("Workspace '{}' does not exist".format(element_name))
@@ -384,8 +384,8 @@ class App():
.format(workspace.path, e)) from e
# Delete the workspace and save the configuration
- self.project._workspaces.delete_workspace(element_name)
- self.project._workspaces.save_config()
+ self.project.workspaces.delete_workspace(element_name)
+ self.project.workspaces.save_config()
self.message(MessageType.INFO, "Saved workspace configuration")
# reset_workspace
@@ -400,7 +400,7 @@ class App():
def reset_workspace(self, track, no_checkout):
# When working on workspaces we only have one target
target = self.pipeline.targets[0]
- workspace = self.project._workspaces.get_workspace(target.name)
+ workspace = self.project.workspaces.get_workspace(target.name)
if workspace is None:
raise AppError("Workspace '{}' is currently not defined"
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index bb40a45bf..19e78be4b 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -629,7 +629,7 @@ def workspace_list(app):
with app.partially_initialized():
workspaces = []
- for element_name, workspace_ in app.project._workspaces.list():
+ for element_name, workspace_ in app.project.workspaces.list():
workspace_detail = {
'element': element_name,
'directory': workspace_.path,
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py
index dd934182c..01823e83d 100644
--- a/buildstream/_frontend/widget.py
+++ b/buildstream/_frontend/widget.py
@@ -529,11 +529,11 @@ class LogLine(Widget):
text += '\n'
# Project Options
- if project._options.variables:
+ if project.options.variables:
text += self.content_profile.fmt("Project Options\n", bold=True)
values = OrderedDict()
- for key in sorted(project._options.variables):
- values[key] = project._options.variables[key]
+ for key in sorted(project.options.variables):
+ values[key] = project.options.variables[key]
text += self.format_values(values)
text += '\n'