Skip to content
Snippets Groups Projects
Commit 7ec17e6a authored by Langella Olivier's avatar Langella Olivier
Browse files

fix python3 syntax

parent 3c71c958
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
import sys import sys
sys.path.append("@CMAKE_INSTALL_PREFIX@/lib/groupingprotein") sys.path.append("@CMAKE_INSTALL_PREFIX@/lib/groupingprotein")
import codecs
import xml.sax import xml.sax
import re import re
from xmlstreamwriter import Writer from xmlstreamwriter import Writer
...@@ -103,7 +102,7 @@ command.add_argument('-e', '--evalue', default=0.05, type=float, \ ...@@ -103,7 +102,7 @@ command.add_argument('-e', '--evalue', default=0.05, type=float, \
command.add_argument('-b', '--bug', default=False, type=bool, \ command.add_argument('-b', '--bug', default=False, type=bool, \
help='Circumvent X!Tandem bug in refine mode (default: False)') help='Circumvent X!Tandem bug in refine mode (default: False)')
command.add_argument('-o', '--outfile', nargs="?", \ command.add_argument('-o', '--outfile', nargs="?", \
type=str, default="-", \ type=argparse.FileType("w"), default=sys.stdout, \
help='Save peptide result default:STDOUT') help='Save peptide result default:STDOUT')
command.add_argument('files', metavar='files', nargs='+', \ command.add_argument('files', metavar='files', nargs='+', \
help='List of X!Tandem files to process') help='List of X!Tandem files to process')
...@@ -114,12 +113,7 @@ command.add_argument('-v', '--version', action='version', \ ...@@ -114,12 +113,7 @@ command.add_argument('-v', '--version', action='version', \
args = command.parse_args() args = command.parse_args()
#Initialise the Output #Initialise the Output
if args.outfile == "-": writer = Writer(args.outfile)
outfile = codecs.getwriter('utf8')(sys.stdout)
else:
outfile = codecs.open(args.outfile, "w", "utf-8")
writer = Writer(outfile)
writer.set_auto_formatting(False) writer.set_auto_formatting(False)
writer.write_start_document() writer.write_start_document()
writer.write_start_element("peptide_result") writer.write_start_element("peptide_result")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment