diff __efetch_build_options.py @ 1:196b8dd07896 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit a4b0969b33a68a0ea9ba12291f6694aec24f13ed
author iuc
date Tue, 30 Oct 2018 19:10:51 -0400
parents 18e6b25259ff
children ae3a5d753d42
line wrap: on
line diff
--- a/__efetch_build_options.py	Thu Jul 07 02:40:33 2016 -0400
+++ b/__efetch_build_options.py	Tue Oct 30 19:10:51 2018 -0400
@@ -1,6 +1,8 @@
 #!/usr/bin/env python
 # Daniel Blankenberg
 # Creates the options for tool interface
+from __future__ import print_function
+
 import re
 
 # http://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi
@@ -164,7 +166,7 @@
 
 section = None
 for line in help:
-    line = re.split('\s{2,}', line.strip())
+    line = re.split(r'\s{2,}', line.strip())
     # Ignore empties
     if len(line) == 0:
         continue
@@ -214,9 +216,9 @@
 
 format_names = {}
 
-print '''  <xml name="db">
+print('''  <xml name="db">
     <conditional name="db">
-      <expand macro="dbselect" />'''
+      <expand macro="dbselect" />''')
 for key in sorted(db):
     format_options = []
 
@@ -233,13 +235,13 @@
 
         format_names[format_string] = format_modifier
 
-    print WHEN_TPL.format(
+    print(WHEN_TPL.format(
         format=key,
         format_options='\n          '.join(format_options)
-    )
+    ))
 
-print '''    </conditional>
-  </xml>'''
+print('''    </conditional>
+  </xml>''')
 
 CHANGE_FORMAT_TPL = '''
   <xml name="efetch_formats">
@@ -264,4 +266,4 @@
         key=k, value=v
     ))
 
-print CHANGE_FORMAT_TPL.format(formats='\n      '.join(whens))
+print(CHANGE_FORMAT_TPL.format(formats='\n      '.join(whens)))