changeset 8:ae27dab228b8 draft

Uploaded
author jjohnson
date Tue, 21 Feb 2017 12:59:26 -0500
parents 72c32037fa1e
children 0ed75ed20c7e
files query_tabular.py query_tabular.xml
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/query_tabular.py	Sat Feb 18 08:35:35 2017 -0500
+++ b/query_tabular.py	Tue Feb 21 12:59:26 2017 -0500
@@ -63,7 +63,7 @@
     def __init__(self,source,filter_dict):
         self.source = source
         self.filter_dict = filter_dict
-        print >> sys.stderr, 'LineFilter %s' % filter_dict if filter_dict else 'NONE'
+        # print >> sys.stderr, 'LineFilter %s' % filter_dict if filter_dict else 'NONE'
         self.func = lambda l: l.rstrip('\r\n') if l else None
         if not filter_dict:
             return
--- a/query_tabular.xml	Sat Feb 18 08:35:35 2017 -0500
+++ b/query_tabular.xml	Tue Feb 21 12:59:26 2017 -0500
@@ -7,16 +7,17 @@
         <exit_code range="1:" />
     </stdio>
     <command><![CDATA[
+        cat $query_file &&
         #if $add_to_database.withdb: 
             #if $save_db:
-                cp "$add_to_database.withdb" "$save_db" &&
+                cp "$add_to_database.withdb" "$sqlitedb" &&
             #else:
                 cp "$add_to_database.withdb" "$workdb" &&
             #end if 
         #end if
         python $__tool_directory__/query_tabular.py 
         #if $save_db
-        -s $sqlitedb
+        -s "$sqlitedb"
         #else
         -s $workdb
         #end if
@@ -26,8 +27,6 @@
           $no_header
           -o $output
         #end if
-        && cat $query_file
-        && cat $table_json
     ]]></command>
     <configfiles>
         <configfile name="query_file">
@@ -80,7 +79,7 @@
   #set $input_filters = []
   #for $fi in $tbl.input_opts.linefilters:
     #if $fi.filter.filter_type == 'skip':
-      #if str($tbl.tbl_opts.skip_lines) != '':
+      #if str($fi.filter.skip_lines) != '':
         #set $jtbl['comment_lines'] = int($fi.filter.skip_lines)
       #elif $tbl.table.metadata.comment_lines and $tbl.table.metadata.comment_lines > 0:
         #set $jtbl['comment_lines'] = int($tbl.table.metadata.comment_lines)
@@ -122,7 +121,7 @@
             <param name="withdb" type="data" format="sqlite" optional="true" label="Add tables to this Database" 
                help="Make sure your added table names are not already in this database"/>
         </section>
-        <repeat name="tables" title="Database Table" min="1">
+        <repeat name="tables" title="Database Table" min="0">
             <param name="table" type="data" format="tabular" label="Tabular Dataset for Table"/>
             <section name="input_opts" expanded="false" title="Filter Dataset Input">
                 <repeat name="linefilters" title="Filter Tabular Input Lines">
@@ -137,11 +136,12 @@
                             -->
                         </param>
                         <when value="skip">
-                             <param name="skip_lines" type="integer" value="" min="0" label="Skip lines" 
+                             <param name="skip_lines" type="integer" value="" min="0" optional="true" label="Skip lines" 
                                  help="Leave blank to use the comment lines metadata for this dataset" />
                         </when>
                         <when value="comment">
                             <param name="comment_char" type="text" value="#" label="Comment line starting text">
+                                <sanitizer sanitize="False"/>
                             </param>
                         </when>
                         <when value="regex">