summaryrefslogtreecommitdiff
path: root/buildstream/_context.py
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-01-21 13:58:55 +0100
committerJürg Billeter <j@bitron.ch>2019-01-24 14:37:28 +0100
commitab72d384a0b79b55543e1e7facd00f4778bbc780 (patch)
treec930e804572f646c13bd94d7aa926848930e355c /buildstream/_context.py
parent3850274b423fff404ed3acaf1a21f271b07c6a08 (diff)
downloadbuildstream-ab72d384a0b79b55543e1e7facd00f4778bbc780.tar.gz
_project.py: Add get_default_target() and get_default_targets() methods
_frontend/cli.py: Use new methods. Based on patches by Phillip Smyth.
Diffstat (limited to 'buildstream/_context.py')
-rw-r--r--buildstream/_context.py16
1 files changed, 1 insertions, 15 deletions
diff --git a/buildstream/_context.py b/buildstream/_context.py
index 8b9f47bd6..f14f6b746 100644
--- a/buildstream/_context.py
+++ b/buildstream/_context.py
@@ -32,7 +32,7 @@ from ._message import Message, MessageType
from ._profile import Topics, profile_start, profile_end
from ._artifactcache import ArtifactCache
from ._cas import CASCache
-from ._workspaces import Workspaces, WorkspaceProjectCache, WORKSPACE_PROJECT_FILE
+from ._workspaces import Workspaces, WorkspaceProjectCache
from .plugin import _plugin_lookup
from .sandbox import SandboxRemote
@@ -657,20 +657,6 @@ class Context():
self._cascache = CASCache(self.artifactdir)
return self._cascache
- # guess_element()
- #
- # Attempts to interpret which element the user intended to run commands on
- #
- # Returns:
- # (str) The name of the element, or None if no element can be guessed
- def guess_element(self):
- workspace_project_dir, _ = utils._search_upward_for_files(self._directory, [WORKSPACE_PROJECT_FILE])
- if workspace_project_dir:
- workspace_project = self._workspace_project_cache.get(workspace_project_dir)
- return workspace_project.get_default_element()
- else:
- return None
-
# _node_get_option_str()
#