Revert " Implement feature new format: Cli. Generate adapter for tabulate. This close issue #340"

This reverts commit c26159d48f.
The patch was NOT ready to be merged.
This commit is contained in:
Claude Paroz
2019-10-30 14:24:07 +01:00
parent c26159d48f
commit d21bd10908
5 changed files with 1 additions and 37 deletions
-1
View File
@@ -9,7 +9,6 @@ install = [
'xlrd',
'xlwt',
'pyyaml',
'tabulate',
]
-8
View File
@@ -621,14 +621,6 @@ class Dataset:
"""
pass
@property
def cli():
"""A CLI table representation of the :class:`Dataset` object.
.. note:: This method can be used for export only.
"""
pass
@property
def jira():
"""A Jira table representation of the :class:`Dataset` object.
+1 -2
View File
@@ -14,7 +14,6 @@ from . import _tsv as tsv
from . import _xls as xls
from . import _xlsx as xlsx
from . import _yaml as yaml
from . import _cli as cli
# xlsx before as xls (xlrd) can also read xlsx
available = (json, xlsx, xls, yaml, csv, dbf, tsv, html, jira, latex, ods, df, rst, cli)
available = (json, xlsx, xls, yaml, csv, dbf, tsv, html, jira, latex, ods, df, rst)
-20
View File
@@ -1,20 +0,0 @@
""" Tablib - CLI Support
"""
from tabulate import tabulate
title = 'cli'
extensions = ('txt',)
DEFAULT_FORMAT = 'plain'
def export_set(dataset, **kwargs):
"""Returns CLI representation of Dataset."""
if( dataset.headers is not None ):
kwargs.setdefault('headers', dataset.headers)
kwargs.setdefault('tablefmt', DEFAULT_FORMAT)
return tabulate( dataset, **kwargs)
def export_book(dataset, **kwargs):
"""Returns CLI representation of Dataset."""
kwargs.setdefault('tablefmt', DEFAULT_FORMAT)
return tabulate( dataset, **kwargs)
-6
View File
@@ -1214,12 +1214,6 @@ class JiraTests(BaseTestCase):
def test_jira_export_empty_dataset(self):
self.assertTrue(tablib.Dataset().jira is not None)
class CliTests(BaseTestCase):
def test_cli_export(self):
self.assertEqual('a b c', tablib.Dataset(['a', 'b', 'c']).cli)
def test_cli_export_github(self):
self.assertEqual('|---|---|---|\n| a | b | c |', tablib.Dataset(['a','b','c']).export('cli',tablefmt='github'))
class DocTests(unittest.TestCase):