[med-svn] [Git][med-team/cwltool][upstream] New upstream version 1.0.20180302231433

Michael R. Crusoe gitlab at salsa.debian.org
Mon Mar 5 16:43:25 UTC 2018


Michael R. Crusoe pushed to branch upstream at Debian Med / cwltool


Commits:
9c74d157 by Michael R. Crusoe at 2018-03-05T06:33:41-08:00
New upstream version 1.0.20180302231433
- - - - -


7 changed files:

- Makefile
- PKG-INFO
- cwltool.egg-info/PKG-INFO
- cwltool/expression.py
- cwltool/sandboxjs.py
- setup.cfg
- setup.py


Changes:

=====================================
Makefile
=====================================
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
 DEVPKGS=pep8 diff_cover autopep8 pylint coverage pydocstyle flake8 pytest isort mock
 DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
 	   python-flake8 python-mock shellcheck
-VERSION=1.0.$(shell date +%Y%m%d%H%M%S --date=`git log --first-parent \
+VERSION=1.0.$(shell date +%Y%m%d%H%M%S --utc --date=`git log --first-parent \
 	--max-count=1 --format=format:%cI`)
 mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
 
@@ -190,4 +190,3 @@ FORCE:
 # Example `make print-VERSION`
 # From https://www.cmcrossroads.com/article/printing-value-makefile-variable
 print-%  : ; @echo $* = $($*)
-


=====================================
PKG-INFO
=====================================
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: cwltool
-Version: 1.0.20180225105849
+Version: 1.0.20180302231433
 Summary: Common workflow language reference implementation
 Home-page: https://github.com/common-workflow-language/cwltool
 Author: Common workflow language working group
@@ -616,7 +616,6 @@ Classifier: Operating System :: Microsoft :: Windows :: Windows 8.1
 Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6


=====================================
cwltool.egg-info/PKG-INFO
=====================================
--- a/cwltool.egg-info/PKG-INFO
+++ b/cwltool.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: cwltool
-Version: 1.0.20180225105849
+Version: 1.0.20180302231433
 Summary: Common workflow language reference implementation
 Home-page: https://github.com/common-workflow-language/cwltool
 Author: Common workflow language working group
@@ -616,7 +616,6 @@ Classifier: Operating System :: Microsoft :: Windows :: Windows 8.1
 Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.3
 Classifier: Programming Language :: Python :: 3.4
 Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6


=====================================
cwltool/expression.py
=====================================
--- a/cwltool/expression.py
+++ b/cwltool/expression.py
@@ -120,55 +120,76 @@ def scanner(scan):  # type: (Text) -> List[int]
         return None
 
 
-def next_seg(remain, obj):  # type: (Text, Any) -> Any
-    if remain:
-        m = segment_re.match(remain)
+def next_seg(parsed_string, remaining_string, current_value):  # type: (Text, Text, Any) -> Any
+    if remaining_string:
+        m = segment_re.match(remaining_string)
+        next_segment_str = m.group(0)
+
         key = None  # type: Union[Text, int]
-        if m.group(0)[0] == '.':
-            key = m.group(0)[1:]
-        elif m.group(0)[1] in ("'", '"'):
-            key = m.group(0)[2:-2].replace("\\'", "'").replace('\\"', '"')
+        if next_segment_str[0] == '.':
+            key = next_segment_str[1:]
+        elif next_segment_str[1] in ("'", '"'):
+            key = next_segment_str[2:-2].replace("\\'", "'").replace('\\"', '"')
 
         if key:
-            if isinstance(obj, list) and key == "length" and not remain[m.end(0):]:
-                return len(obj)
-            if not isinstance(obj, dict):
-                raise WorkflowException(" is a %s, cannot index on string '%s'" % (type(obj).__name__, key))
-            if key not in obj:
-                raise WorkflowException(" does not contain key '%s'" % key)
+            if isinstance(current_value, list) and key == "length" and not remaining_string[m.end(0):]:
+                return len(current_value)
+            if not isinstance(current_value, dict):
+                raise WorkflowException("%s is a %s, cannot index on string '%s'" % (parsed_string, type(current_value).__name__, key))
+            if key not in current_value:
+                raise WorkflowException("%s does not contain key '%s'" % (parsed_string, key))
         else:
             try:
-                key = int(m.group(0)[1:-1])
+                key = int(next_segment_str[1:-1])
             except ValueError as v:
                 raise WorkflowException(u(str(v)))
-            if not isinstance(obj, list):
-                raise WorkflowException(" is a %s, cannot index on int '%s'" % (type(obj).__name__, key))
-            if key >= len(obj):
-                raise WorkflowException(" list index %i out of range" % key)
+            if not isinstance(current_value, list):
+                raise WorkflowException("%s is a %s, cannot index on int '%s'" % (parsed_string, type(current_value).__name__, key))
+            if key >= len(current_value):
+                raise WorkflowException("%s list index %i out of range" % (parsed_string, key))
+
         try:
-            return next_seg(remain[m.end(0):], obj[key])
-        except WorkflowException as w:
-            raise WorkflowException("%s%s" % (m.group(0), w))
+            return next_seg(parsed_string + remaining_string, remaining_string[m.end(0):], current_value[key])
+        except KeyError:
+            raise WorkflowException("%s doesn't have property %s" % (parsed_string, key))
     else:
-        return obj
+        return current_value
 
 
 def evaluator(ex, jslib, obj, fullJS=False, timeout=None, force_docker_pull=False, debug=False, js_console=False):
     # type: (Text, Text, Dict[Text, Any], bool, int, bool, bool, bool) -> JSON
     m = param_re.match(ex)
+
+    expression_parse_exception = None
+    expression_parse_succeeded = False
+
     if m:
-        if m.end(1)+1 == len(ex) and m.group(1) == "null":
+        first_symbol = m.group(1)
+        first_symbol_end = m.end(1)
+
+        if first_symbol_end + 1 == len(ex) and first_symbol == "null":
             return None
         try:
-            return next_seg(m.group(0)[m.end(1) - m.start(0):-1], obj[m.group(1)])
-        except Exception as w:
-            raise WorkflowException("%s%s" % (m.group(1), w))
-    elif fullJS:
+            if obj.get(first_symbol) is None:
+                raise WorkflowException("%s is not defined" % first_symbol)
+
+            return next_seg(first_symbol, ex[first_symbol_end:-1], obj[first_symbol])
+        except WorkflowException as w:
+            expression_parse_exception = w
+        else:
+            expression_parse_succeeded = True
+
+    if fullJS and not expression_parse_succeeded:
         return sandboxjs.execjs(ex, jslib, timeout=timeout, force_docker_pull=force_docker_pull, debug=debug, js_console=js_console)
     else:
-        raise sandboxjs.JavascriptException(
-            "Syntax error in parameter reference '%s' or used Javascript code without specifying InlineJavascriptRequirement.",
-            ex)
+        if expression_parse_exception is not None:
+            raise sandboxjs.JavascriptException(
+                "Syntax error in parameter reference '%s': %s. This could be due to using Javascript code without specifying InlineJavascriptRequirement." % \
+                    (ex[1:-1], expression_parse_exception))
+        else:
+            raise sandboxjs.JavascriptException(
+                "Syntax error in parameter reference '%s'. This could be due to using Javascript code without specifying InlineJavascriptRequirement." % \
+                    ex)
 
 
 def interpolate(scan, rootvars,


=====================================
cwltool/sandboxjs.py
=====================================
--- a/cwltool/sandboxjs.py
+++ b/cwltool/sandboxjs.py
@@ -292,7 +292,8 @@ def execjs(js, jslib, timeout=None, force_docker_pull=False, debug=False, js_con
         info = u"returncode was: %s\nscript was:\n%s\nstdout was: %s\nstderr was: %s\n" %\
                (nodejs.returncode, fn_linenum(), stdfmt(stdoutdata.decode('utf-8')), stdfmt(stderrdata.decode('utf-8')))
     else:
-        info = stdfmt(stderrdata.decode('utf-8'))
+        info = u"Javascript expression was: %s\nstdout was: %s\nstderr was: %s" %\
+               (js, stdfmt(stdoutdata.decode('utf-8')), stdfmt(stderrdata.decode('utf-8')))
 
     if nodejs.poll() not in (None, 0):
         if killed:


=====================================
setup.cfg
=====================================
--- a/setup.cfg
+++ b/setup.cfg
@@ -13,6 +13,6 @@ addopts = --ignore cwltool/schemas
 testpaths = tests
 
 [egg_info]
-tag_build = .20180225105849
+tag_build = .20180302231433
 tag_date = 0
 


=====================================
setup.py
=====================================
--- a/setup.py
+++ b/setup.py
@@ -88,7 +88,6 @@ setup(name='cwltool',
           'Programming Language :: Python :: 2',
           'Programming Language :: Python :: 2.7',
           'Programming Language :: Python :: 3',
-          'Programming Language :: Python :: 3.3',
           'Programming Language :: Python :: 3.4',
           'Programming Language :: Python :: 3.5',
           'Programming Language :: Python :: 3.6',



View it on GitLab: https://salsa.debian.org/med-team/cwltool/commit/9c74d1573d4c43142d065360a0c436f74d341b28

---
View it on GitLab: https://salsa.debian.org/med-team/cwltool/commit/9c74d1573d4c43142d065360a0c436f74d341b28
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/debian-med-commit/attachments/20180305/92983a8f/attachment-0001.html>


More information about the debian-med-commit mailing list