Skip to content
Snippets Groups Projects
Commit 8dae2eed authored by finnball's avatar finnball
Browse files

Add !path tag which informs parser to expand input.

parent 9bccb336
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,15 @@ class Channel(YamlFactory):
sys.exit(-1)
class Path(YamlFactory):
yaml_tag = u'!path'
def __new__(cls, path):
path = os.path.expanduser(path)
return path
class Disk(YamlFactory):
yaml_tag = u'!disk-storage'
......@@ -197,6 +206,7 @@ def _parse_size(size):
def get_parser():
yaml.SafeLoader.add_constructor(Channel.yaml_tag, Channel.from_yaml)
yaml.SafeLoader.add_constructor(Path.yaml_tag, Path.from_yaml)
yaml.SafeLoader.add_constructor(Execution.yaml_tag, Execution.from_yaml)
yaml.SafeLoader.add_constructor(Action.yaml_tag, Action.from_yaml)
yaml.SafeLoader.add_constructor(Reference.yaml_tag, Reference.from_yaml)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment