This is an automated email from the ASF dual-hosted git repository. github-bot pushed a commit to branch jonathan/mirror-client in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 70404399ea36f6969c1742182f9611269df12b4f Author: Jonathan Maw <[email protected]> AuthorDate: Mon Apr 9 16:18:27 2018 +0100 Move _ALIAS_SEPARATOR into utils The separator is useful in source files other than _project.py --- buildstream/_project.py | 8 ++------ buildstream/utils.py | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/buildstream/_project.py b/buildstream/_project.py index d1827d7..b23a5a8 100644 --- a/buildstream/_project.py +++ b/buildstream/_project.py @@ -37,10 +37,6 @@ from ._versions import BST_FORMAT_VERSION from ._workspaces import Workspaces -# The separator we use for user specified aliases -_ALIAS_SEPARATOR = ':' - - # HostMount() # # A simple object describing the behavior of @@ -135,8 +131,8 @@ class Project(): # fully qualified urls based on the shorthand which is allowed # to be specified in the YAML def translate_url(self, url): - if url and _ALIAS_SEPARATOR in url: - url_alias, url_body = url.split(_ALIAS_SEPARATOR, 1) + if url and utils._ALIAS_SEPARATOR in url: + url_alias, url_body = url.split(utils._ALIAS_SEPARATOR, 1) alias_url = self._aliases.get(url_alias) if alias_url: url = alias_url + url_body diff --git a/buildstream/utils.py b/buildstream/utils.py index 8e72196..595a040 100644 --- a/buildstream/utils.py +++ b/buildstream/utils.py @@ -43,6 +43,10 @@ from . import _signals from ._exceptions import BstError, ErrorDomain +# The separator we use for user specified aliases +_ALIAS_SEPARATOR = ':' + + class UtilError(BstError): """Raised by utility functions when system calls fail.
