diff planemo/lib/python3.7/site-packages/galaxy/tool_util/parser/util.py @ 1:56ad4e20f292 draft

"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
author guerler
date Fri, 31 Jul 2020 00:32:28 -0400 (2020-07-31)
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/planemo/lib/python3.7/site-packages/galaxy/tool_util/parser/util.py	Fri Jul 31 00:32:28 2020 -0400
@@ -0,0 +1,21 @@
+from collections import OrderedDict
+
+DEFAULT_DELTA = 10000
+DEFAULT_DELTA_FRAC = None
+
+
+def is_dict(item):
+    return isinstance(item, dict) or isinstance(item, OrderedDict)
+
+
+def _parse_name(name, argument):
+    """Determine name of an input source from name and argument
+    returns the name or if absent the argument property
+    In the latter case, leading dashes are stripped and
+    all remaining dashes are replaced by underscores.
+    """
+    if name is None:
+        if not argument:
+            raise ValueError("parameter must specify a 'name' or 'argument'.")
+        name = argument.lstrip('-').replace("-", "_")
+    return name