Skip to content

Commit

Permalink
don't import as
Browse files Browse the repository at this point in the history
  • Loading branch information
meeuw committed Apr 15, 2017
1 parent 39c4aec commit 9c70ce1
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions mycli/output_formatter/output_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@

from .expanded import expanded_table
from .preprocessors import (override_missing_value, convert_to_string)
from .delimited_output_adapter import (delimiter_adapter,
supported_formats as delimiter_formats,
delimiter_preprocessors)
from .tabulate_adapter import (tabulate_adapter,
supported_formats as tabulate_formats,
preprocessors as tabulate_preprocessors)
from .terminaltables_adapter import (
terminaltables_adapter, preprocessors as terminaltables_preprocessors,
supported_formats as terminaltables_formats)

from . import delimited_output_adapter
from . import tabulate_adapter
from . import terminaltables_adapter

MISSING_VALUE = '<null>'

Expand Down Expand Up @@ -81,20 +76,20 @@ def format_output(self, data, headers, format_name=None, **kwargs):
convert_to_string),
{'missing_value': MISSING_VALUE})

for delimiter_format in delimiter_formats:
OutputFormatter.register_new_formatter(delimiter_format, delimiter_adapter,
delimiter_preprocessors,
{'table_format': delimiter_format,
'missing_value': MISSING_VALUE})
for delimiter_format in delimited_output_adapter.supported_formats:
OutputFormatter.register_new_formatter(
delimiter_format, delimited_output_adapter.delimiter_adapter,
delimited_output_adapter.delimiter_preprocessors,
{'table_format': delimiter_format, 'missing_value': MISSING_VALUE})

for tabulate_format in tabulate_formats:
OutputFormatter.register_new_formatter(tabulate_format, tabulate_adapter,
tabulate_preprocessors,
{'table_format': tabulate_format,
'missing_value': MISSING_VALUE})
for tabulate_format in tabulate_adapter.supported_formats:
OutputFormatter.register_new_formatter(
tabulate_format, tabulate_adapter.tabulate_adapter,
tabulate_adapter.preprocessors,
{'table_format': tabulate_format, 'missing_value': MISSING_VALUE})

for terminaltables_format in terminaltables_formats:
for terminaltables_format in terminaltables_adapter.supported_formats:
OutputFormatter.register_new_formatter(
terminaltables_format, terminaltables_adapter,
terminaltables_preprocessors,
terminaltables_format, terminaltables_adapter.terminaltables_adapter,
terminaltables_adapter.preprocessors,
{'table_format': terminaltables_format, 'missing_value': MISSING_VALUE})

0 comments on commit 9c70ce1

Please sign in to comment.