|
1 | 1 | from __future__ import absolute_import |
2 | 2 | import copy |
3 | 3 | import hashlib |
| 4 | +import locale |
4 | 5 | import json |
5 | 6 | import logging |
6 | 7 | import os |
@@ -208,7 +209,7 @@ def makeJobRunner(self, use_container=True, **kwargs): # type: (Optional[bool], |
208 | 209 | }) |
209 | 210 | dockerReq = self.requirements[0] |
210 | 211 | if default_container == windows_default_container_id and use_container and onWindows(): |
211 | | - _logger.warning(DEFAULT_CONTAINER_MSG%(windows_default_container_id, windows_default_container_id)) |
| 212 | + _logger.warning(DEFAULT_CONTAINER_MSG % (windows_default_container_id, windows_default_container_id)) |
212 | 213 |
|
213 | 214 | if dockerReq and use_container: |
214 | 215 | return DockerCommandLineJob() |
@@ -523,8 +524,8 @@ def collect_output_ports(self, ports, builder, outdir, compute_checksum=True, jo |
523 | 524 | for i, port in enumerate(ports): |
524 | 525 | def makeWorkflowException(msg): |
525 | 526 | return WorkflowException( |
526 | | - u"Error collecting output for parameter '%s':\n%s" |
527 | | - % (shortname(port["id"]), msg)) |
| 527 | + u"Error collecting output for parameter '%s':\n%s" |
| 528 | + % (shortname(port["id"]), msg)) |
528 | 529 | with SourceLine(ports, i, makeWorkflowException, debug): |
529 | 530 | fragment = shortname(port["id"]) |
530 | 531 | ret[fragment] = self.collect_output(port, builder, outdir, fs_access, |
@@ -575,16 +576,23 @@ def collect_output(self, schema, builder, outdir, fs_access, compute_checksum=Tr |
575 | 576 | elif gb == ".": |
576 | 577 | gb = outdir |
577 | 578 | elif gb.startswith("/"): |
578 | | - raise WorkflowException("glob patterns must not start with '/'") |
| 579 | + raise WorkflowException( |
| 580 | + "glob patterns must not start with '/'") |
579 | 581 | try: |
580 | 582 | prefix = fs_access.glob(outdir) |
581 | 583 | r.extend([{"location": g, |
582 | | - "path": fs_access.join(builder.outdir, g[len(prefix[0])+1:]), |
| 584 | + "path": fs_access.join(builder.outdir, |
| 585 | + g[len(prefix[0])+1:]), |
583 | 586 | "basename": os.path.basename(g), |
584 | | - "nameroot": os.path.splitext(os.path.basename(g))[0], |
585 | | - "nameext": os.path.splitext(os.path.basename(g))[1], |
586 | | - "class": "File" if fs_access.isfile(g) else "Directory"} |
587 | | - for g in fs_access.glob(fs_access.join(outdir, gb))]) |
| 587 | + "nameroot": os.path.splitext( |
| 588 | + os.path.basename(g))[0], |
| 589 | + "nameext": os.path.splitext( |
| 590 | + os.path.basename(g))[1], |
| 591 | + "class": "File" if fs_access.isfile(g) |
| 592 | + else "Directory"} |
| 593 | + for g in sorted(fs_access.glob( |
| 594 | + fs_access.join(outdir, gb)), |
| 595 | + cmp=locale.strcoll)]) |
588 | 596 | except (OSError, IOError) as e: |
589 | 597 | _logger.warning(Text(e)) |
590 | 598 | except: |
|
0 commit comments