Skip to content

Commit

Permalink
Remove further calls to io.BytesIO() in favour of just using files in…
Browse files Browse the repository at this point in the history
…stead.
  • Loading branch information
james-strauss-uwa committed Sep 24, 2020
1 parent a508db0 commit a33c237
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 1 addition & 4 deletions daliuge-translator/dlg/translator/tool_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,10 @@ def cwl(parser, args):

# create the CWL workflow
from ..dropmake.cwl import create_workflow
import io
buffer = io.BytesIO()
create_workflow(pgt, "workflow.cwl", buffer)

# write to file
with _open_o(opts.output, "wb") as f:
f.write(buffer.getvalue())
create_workflow(pgt, "workflow.cwl", f)

def register_commands():
tool.cmdwrap('lgweb', 'A Web server for the Logical Graph Editor', 'dlg.dropmake.web.lg_web:run')
Expand Down
6 changes: 1 addition & 5 deletions daliuge-translator/test/dropmake/test_pg_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ def test_pg_eagle(self):

def test_cwl_translate(self):
import git
import io
import os
import shutil
import uuid
Expand Down Expand Up @@ -206,12 +205,9 @@ def test_cwl_translate(self):
cwl_out_zip = cwl_output_dir + '/workflow.zip'
output_list.append((cwl_out, cwl_out_zip))

buffer = io.BytesIO()
create_workflow(pgt, 'workflow.cwl', buffer)

# write output
with open(cwl_out_zip, 'wb') as f:
f.write(buffer.getvalue())
create_workflow(pgt, 'workflow.cwl', f)

for out, zip in output_list:
zip_ref = zipfile.ZipFile(zip)
Expand Down

0 comments on commit a33c237

Please sign in to comment.