1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 02 Mar 2017 11:51:33 +0100
Description: Fix Python3 errors by using 2to3
--- a/grepseq
+++ b/grepseq
@@ -14,7 +14,7 @@ def search(regex, filename, options):
cmx = options.max_count
if pfn and not cnt:
- print '\n=======>', filename, '<=======\n'
+ print('\n=======>', filename, '<=======\n')
for seq in io.open(filename, 'r'):
in_name = snm and regex.search(seq.name + ' ' + seq.defline)
@@ -22,16 +22,16 @@ def search(regex, filename, options):
if not inv and (in_name or in_seq):
options.curr_count += 1
if not cnt:
- print seq
+ print(seq)
elif inv and not (in_name or in_seq):
options.curr_count += 1
if not cnt:
- print seq
+ print(seq)
if cmx and options.curr_count > cmx:
break
if cnt:
- print options.curr_count
+ print(options.curr_count)
if __name__ == '__main__':
optp = OptionParser(usage="%prog [options] <pattern> <files ...>")
|