allpy
changeset 1112:349316a4e941
utils/markup_to_file: added ability to specify multiple markup file names for batch tranformation as positional arguments
author | Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru> |
---|---|
date | Fri, 29 Jun 2012 19:34:21 +0400 |
parents | 0736e1bbd186 |
children | 2fbe82ce71ae |
files | utils/markup_to_file.py |
diffstat | 1 files changed, 13 insertions(+), 1 deletions(-) [+] |
line diff
1.1 --- a/utils/markup_to_file.py Thu Jun 14 20:24:26 2012 +0400 1.2 +++ b/utils/markup_to_file.py Fri Jun 29 19:34:21 2012 +0400 1.3 @@ -50,6 +50,18 @@ 1.4 if options.markups: 1.5 options.markups = options.markups.split(",") 1.6 1.7 - main() 1.8 + if args and (options.input_file != "-" or options.output_file != "-"): 1.9 + parser.error("Either specify positional arguments, or -i/-o, never both") 1.10 + 1.11 + if args: 1.12 + for arg in args: 1.13 + options.input_file = arg 1.14 + if arg.endswith(".markup"): 1.15 + arg = arg[:-len(".markup")] 1.16 + options.output_file = arg + ".fasta" 1.17 + sys.stderr.write("{0} -> {1}\n".format(options.input_file, options.output_file)) 1.18 + main() 1.19 + else: 1.20 + main() 1.21 1.22 # vim: set et ts=4 sts=4 sw=4: