diff options
Diffstat (limited to 'buildstream/_context.py')
-rw-r--r-- | buildstream/_context.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/buildstream/_context.py b/buildstream/_context.py index bf7f49515..1a59af2b9 100644 --- a/buildstream/_context.py +++ b/buildstream/_context.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 # # Copyright (C) 2016-2018 Codethink Limited # @@ -30,6 +29,7 @@ from ._exceptions import LoadError, LoadErrorReason, BstError from ._message import Message, MessageType from ._profile import Topics, profile_start, profile_end from ._artifactcache import ArtifactCache +from ._workspaces import Workspaces # Context() @@ -113,6 +113,7 @@ class Context(): self._message_depth = deque() self._projects = [] self._project_overrides = {} + self._workspaces = None # load() # @@ -161,6 +162,7 @@ class Context(): path = _yaml.node_get(defaults, str, directory) path = os.path.expanduser(path) path = os.path.expandvars(path) + path = os.path.normpath(path) setattr(self, directory, path) # Load artifact share configuration @@ -218,6 +220,8 @@ class Context(): # project (Project): The project to add # def add_project(self, project): + if not self._projects: + self._workspaces = Workspaces(project) self._projects.append(project) # get_projects(): @@ -241,6 +245,9 @@ class Context(): def get_toplevel_project(self): return self._projects[0] + def get_workspaces(self): + return self._workspaces + # get_overrides(): # # Fetch the override dictionary for the active project. This returns |