(self)
| 1355 | return ret |
| 1356 | |
| 1357 | def _format_outputstream(self): |
| 1358 | column_names = self.imp_client.get_column_names(self.last_query_handle) |
| 1359 | if sys.version_info.major == 2: |
| 1360 | column_names = [ |
| 1361 | col.decode("utf8", errors="replace") if isinstance(col, str) else col |
| 1362 | for col in column_names] |
| 1363 | if self.write_delimited: |
| 1364 | formatter = DelimitedOutputFormatter(field_delim=self.output_delimiter) |
| 1365 | self.output_stream = OutputStream(formatter, filename=self.output_file) |
| 1366 | # print the column names |
| 1367 | if self.print_header: |
| 1368 | self.output_stream.write([column_names]) |
| 1369 | elif self.vertical: |
| 1370 | formatter = VerticalOutputFormatter(column_names) |
| 1371 | self.output_stream = OutputStream(formatter, filename=self.output_file) |
| 1372 | else: |
| 1373 | prettytable = self.construct_table_with_header(column_names) |
| 1374 | formatter = PrettyOutputFormatter(prettytable) |
| 1375 | self.output_stream = OutputStream(formatter, filename=self.output_file) |
| 1376 | |
| 1377 | def _periodic_wait_callback(self): |
| 1378 | """If enough time elapsed since the last call to the periodic callback, |
no test coverage detected