Skip to content
Snippets Groups Projects

Added support for MCO named parameters.

Merged Adham Hashibon requested to merge mco_parameters into master
1 file
+ 26
2
Compare changes
  • Side-by-side
  • Inline
+ 26
2
@@ -25,6 +25,30 @@ def bundle_id(producer, identifier):
A unique identifier for the bundle. The producer has authority and
control over the uniqueness of this identifier.
Returns
-------
str: an identifier to be used in the bundle.
"""
return _string_id("bundle", producer, identifier)
def mco_parameter_id(producer, identifier):
return _string_id("mco_parameter", producer, identifier)
def _string_id(entity_namespace, producer, identifier):
"""Creates an id for a generic entity.
Parameters
----------
entity_namespace: str
A namespace for the entity we want to address (e.g. "bundle")
producer: str
the company or research institute unique identifier (e.g. "enthought")
identifier: str
A unique identifier for the bundle. The producer has authority and
control over the uniqueness of this identifier.
Returns
-------
str: an identifier to be used in the bundle.
@@ -35,7 +59,7 @@ def bundle_id(producer, identifier):
" " not in entry and
len(entry) != 0)
if not all(map(is_valid, [producer, identifier])):
if not all(map(is_valid, [entity_namespace, producer, identifier])):
raise ValueError("Invalid parameters specified.")
return "force.bdss.bundles.{}.{}".format(producer, identifier)
return "force.bdss.{}.{}.{}".format(entity_namespace, producer, identifier)
Loading