Permalink
Browse files

Implicitly treat .shed.yml contents as unicode.

Eliminates ugly type hints in .shed.yml files created by shed_init - closing #243.
  • Loading branch information...
jmchilton committed Jul 2, 2015
1 parent aad1eed commit f0610d7b91072332f106414f7b8e7b534690cf3e
Showing with 10 additions and 1 deletion.
  1. +10 −1 planemo/shed/__init__.py
@@ -121,6 +121,15 @@
]


def construct_yaml_str(self, node):
# Override the default string handling function
# to always return unicode objects
return self.construct_scalar(node)

yaml.Loader.add_constructor(u'tag:yaml.org,2002:str', construct_yaml_str)
yaml.SafeLoader.add_constructor(u'tag:yaml.org,2002:str', construct_yaml_str)


def shed_init(ctx, path, **kwds):
if not os.path.exists(path):
os.makedirs(path)
@@ -690,7 +699,7 @@ def _create_shed_config(ctx, path, **kwds):
del config[k]

with open(path, "w") as f:
yaml.dump(config, f)
yaml.safe_dump(config, f)


def _parse_repos_from_workflow(path):

0 comments on commit f0610d7

Please sign in to comment.