diff subsamplr.py @ 5:3852b3edc8a4 tip

"planemo upload for repository https://toolrepo.galaxytrakr.org/"
author jpayne
date Fri, 19 Feb 2021 17:51:59 -0500
parents a90a883f88f9
children
line wrap: on
line diff
--- a/subsamplr.py	Fri Feb 19 15:28:20 2021 -0500
+++ b/subsamplr.py	Fri Feb 19 17:51:59 2021 -0500
@@ -43,7 +43,7 @@
     outs = [fout, rout]
 except ValueError: # not enough values to unpack
     try:
-        fin, fout, cov, gen_size, *ops = argv[1:]
+        fin, fout, cov, gen_size, *opts = argv[1:]
         ins = [fin]
         outs = [fout]
     except ValueError:
@@ -70,7 +70,8 @@
     outs = [stack.enter_context(openn(path, 'w')) for openn, path in zip(file_openers, outs)] # opened output files
 
     for file in ins:
-        print(file.name)
+        if hasattr(file, "name"):
+            print(file.name)
 
     # https://en.m.wikipedia.org/wiki/Reservoir_sampling