Skip to content

Commit 76ac261

Browse files
committed
drop some unused imports, still have circular dependencies
1 parent 6ebb695 commit 76ac261

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

cwltool/draft2tool.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@
77
from .pathmapper import PathMapper, DockerPathMapper
88
from .job import CommandLineJob
99
import yaml
10-
import glob
1110
import logging
1211
import hashlib
13-
import random
1412
from .process import Process, shortname, uniquename, adjustFileObjs
1513
from .errors import WorkflowException
1614
import schema_salad.validate as validate
1715
from .aslist import aslist
18-
from . import expression
19-
import re
20-
import urlparse
2116
import tempfile
2217
from .builder import CONTENT_LIMIT, substitute, Builder
2318
import shellescape
@@ -238,7 +233,7 @@ def _check_adjust(f):
238233
for b in builder.bindings:
239234
arg = builder.generate_arg(b)
240235
if b.get("shellQuote", True):
241-
arg = [shellescape.quote(a) for a in aslist(arg)]
236+
arg = [shellescape.quote(c) for c in aslist(arg)]
242237
cmd.extend(aslist(arg))
243238
j.command_line = ["/bin/sh", "-c", " ".join(cmd)]
244239
else:

cwltool/process.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ def uniquename(stem):
407407
_names.add(u)
408408
return u
409409

410+
410411
def scandeps(base, doc, reffields, urlfields):
411412
r = []
412413
if isinstance(doc, dict):

cwltool/workflow.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@ def __init__(self, workflow, **kwargs):
184184
self.outdir = tempfile.mkdtemp()
185185

186186
self.name = uniquename(
187-
"workflow %s" % kwargs.get(
188-
"name", shortname(self.workflow.tool["id"])))
187+
"workflow %s" % kwargs.get(
188+
"name", shortname(self.workflow.tool["id"])))
189189

190190
_logger.debug(
191-
"[%s] initialized step from %s", self.name, self.tool["id"])
191+
"[%s] initialized step from %s", self.name, self.tool["id"])
192192

193193
def receive_output(self, step, outputparms, jobout, processStatus):
194194
for i in outputparms:
@@ -207,10 +207,10 @@ def receive_output(self, step, outputparms, jobout, processStatus):
207207
self.processStatus = processStatus
208208

209209
_logger.warn(
210-
"[%s] completion status is %s", step.name, processStatus)
210+
"[%s] completion status is %s", step.name, processStatus)
211211
else:
212212
_logger.info(
213-
"[%s] completion status is %s", step.name, processStatus)
213+
"[%s] completion status is %s", step.name, processStatus)
214214

215215
step.completed = True
216216

@@ -276,12 +276,13 @@ def valueFromFunc(k, v):
276276
**kwargs)
277277
else:
278278
_logger.debug(
279-
"[job %s] job input %s", step.name,
280-
json.dumps(inputobj, indent=4))
281-
inputobj = {k: valueFromFunc(k, v) for k,v in inputobj.items()}
279+
"[job %s] job input %s", step.name,
280+
json.dumps(inputobj, indent=4))
281+
inputobj = {k: valueFromFunc(k, v)
282+
for k, v in inputobj.items()}
282283
_logger.debug(
283-
"[job %s] evaluated job input to %s", step.name,
284-
json.dumps(inputobj, indent=4))
284+
"[job %s] evaluated job input to %s", step.name,
285+
json.dumps(inputobj, indent=4))
285286
jobs = step.job(inputobj, basedir, callback, **kwargs)
286287

287288
step.submitted = True
@@ -387,8 +388,7 @@ def job(self, joborder, basedir, output_callback, move_outputs=True,
387388
if not os.path.exists(dirname):
388389
os.makedirs(dirname)
389390
_logger.debug(
390-
"[%s] Moving '%s' to '%s'",
391-
self.name, src, dst)
391+
"[%s] Moving '%s' to '%s'", self.name, src, dst)
392392
shutil.move(src, dst)
393393
f["path"] = dst
394394

@@ -398,8 +398,6 @@ def job(self, joborder, basedir, output_callback, move_outputs=True,
398398
_logger.debug(
399399
"[%s] Removing intermediate output "
400400
"directory %s", self.name, a)
401-
"[workflow %s] Removing intermediate output "
402-
"directory %s", self.name, a)
403401
shutil.rmtree(a, True)
404402

405403
_logger.info("[%s] outdir is %s", self.name, self.outdir)

0 commit comments

Comments
 (0)