cloudmesh-common.cloudmesh.common.parameter

Module Contents

Classes

Parameter

class cloudmesh-common.cloudmesh.common.parameter.Parameter

Bases: object

static _expand(values)

given a string of the form “a,g-h,k,x-z” expand it tl a list with all characters between the - being expanded

Parameters

values – string of the form “a,g-h,k,x-z”

Returns

classmethod expand_string(cls, parameter)

can expand strings, but only allows either, or - in [] not mixed

Parameters

parameter – string of the form prefix[a,g-h,k,x-z]postfix

Returns

classmethod expand(cls, parameter, allow_duplicates=False, sort=False, sep=':')

Parameter.expand(“a[0-1]”) -> [“a0”, “a1”] Content sensitive : expansion Parameter.expand(“local:a0,a1”) -> [“local:a0”, “local:a1”] instead of Parameter.expand(“local:[a0,a1]”) -> [“local:a0”, “local:a1”]

Parameters
  • parameter

  • allow_duplicates

  • sort

Returns

static find(name, *dicts)

Finds the value for the key name in multiple dicts

Parameters
  • name – the key to find

  • dicts – the list of dicts

Returns

static find_bool(name, *dicts)

Finds the value for the key name in multiple dicts

Parameters
  • name – the key to find

  • dicts – the list of dicts

Returns

static arguments_to_dict(arguments)

converts a string of the form “a=1,b=2” to a dict {“a”:”1”, “b”:”2”} all values are strings

Parameters

arguments – the argument string

Returns

a dic of argument and values

static separate(text, sep=':')