Mercurial > repos > iuc > sqlite_to_tabular
comparison sqlite_to_tabular.py @ 1:c1b700bc0150 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/query_tabular commit 81f69ad5f39223059c40501e55ac777d3feca845
| author | iuc |
|---|---|
| date | Fri, 18 Aug 2017 16:48:20 -0400 |
| parents | 859064f07be4 |
| children |
comparison
equal
deleted
inserted
replaced
| 0:859064f07be4 | 1:c1b700bc0150 |
|---|---|
| 19 parser.add_option('-Q', '--query_file', dest='query_file', default=None, | 19 parser.add_option('-Q', '--query_file', dest='query_file', default=None, |
| 20 help='SQL query file') | 20 help='SQL query file') |
| 21 parser.add_option('-n', '--no_header', dest='no_header', default=False, | 21 parser.add_option('-n', '--no_header', dest='no_header', default=False, |
| 22 action='store_true', | 22 action='store_true', |
| 23 help='Include a column headers line') | 23 help='Include a column headers line') |
| 24 parser.add_option('-c', '--comment_char', dest='comment_char', default='', | |
| 25 help='comment character to prefix column header line') | |
| 24 parser.add_option('-o', '--output', dest='output', default=None, | 26 parser.add_option('-o', '--output', dest='output', default=None, |
| 25 help='Output file for query results') | 27 help='Output file for query results') |
| 26 (options, args) = parser.parse_args() | 28 (options, args) = parser.parse_args() |
| 27 | 29 |
| 28 # determine output destination | 30 # determine output destination |
| 49 exit('Error: %s' % (e)) | 51 exit('Error: %s' % (e)) |
| 50 exit(0) | 52 exit(0) |
| 51 else: | 53 else: |
| 52 try: | 54 try: |
| 53 run_query(get_connection(options.sqlitedb), query, outputFile, | 55 run_query(get_connection(options.sqlitedb), query, outputFile, |
| 54 no_header=options.no_header) | 56 no_header=options.no_header, |
| 57 comment_char=options.comment_char) | |
| 55 except Exception as e: | 58 except Exception as e: |
| 56 exit('Error: %s' % (e)) | 59 exit('Error: %s' % (e)) |
| 57 | 60 |
| 58 | 61 |
| 59 if __name__ == "__main__": | 62 if __name__ == "__main__": |
