summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2018-04-09 16:18:27 +0100
committerJonathan Maw <jonathan.maw@codethink.co.uk>2018-06-25 17:39:43 +0100
commit16172e2545494653a7e332e22df43ce6f1ecffc5 (patch)
treec1faacf0476e9e8610629f6eae9e1a89a94de466
parent038ae8ebd0788ce0435799802a203a291b973e8e (diff)
downloadbuildstream-16172e2545494653a7e332e22df43ce6f1ecffc5.tar.gz
Move _ALIAS_SEPARATOR into utils
The separator is useful in source files other than _project.py
-rw-r--r--buildstream/_project.py7
-rw-r--r--buildstream/utils.py4
2 files changed, 6 insertions, 5 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py
index 7cf882b23..9054ae27d 100644
--- a/buildstream/_project.py
+++ b/buildstream/_project.py
@@ -35,9 +35,6 @@ from ._projectrefs import ProjectRefs, ProjectRefStorage
from ._versions import BST_FORMAT_VERSION
-# The separator we use for user specified aliases
-_ALIAS_SEPARATOR = ':'
-
# Project Configuration file
_PROJECT_CONF_FILE = 'project.conf'
@@ -136,8 +133,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 b81a6c852..c22a6f8fd 100644
--- a/buildstream/utils.py
+++ b/buildstream/utils.py
@@ -42,6 +42,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.