diff options
-rw-r--r-- | .travis.yml | 22 | ||||
-rw-r--r-- | README.rst | 14 | ||||
-rw-r--r-- | docs/tutorial.rst | 2 | ||||
-rw-r--r-- | prettytable/__init__.py | 2 | ||||
-rw-r--r-- | prettytable/prettytable.py | 6 | ||||
-rw-r--r-- | setup.py | 9 |
6 files changed, 33 insertions, 22 deletions
diff --git a/.travis.yml b/.travis.yml index 96bcd7c..c704523 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,24 @@ language: python -python: - - "2.7" - - "3.3" - - "3.4" + +matrix: + include: + - python: "2.7" + - python: "3.4" + - python: "3.5" + - python: "3.6" + - python: "3.7" + dist: xenial + sudo: required install: - "pip install -r req-dev.txt" + - "pip install flake8" + +before_script: + # stop the build if there are Python syntax errors or undefined names + - time flake8 . --count --exclude=_compact.py --select=E901,E999,F821,F822,F823 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + - time flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics script: make test after_success: coveralls - @@ -4,7 +4,7 @@ About PTable PTable is a simple Python library designed to make it quick and easy to represent tabular data in visually appealing ASCII tables, originally -forked from `PrettyTable <https://code.google.com/p/prettytable/>`_ . +forked from `PrettyTable <https://code.google.com/p/prettytable/>`_. .. image:: https://travis-ci.org/kxxoling/PTable.svg :target: https://travis-ci.org/kxxoling/PTable @@ -18,21 +18,17 @@ forked from `PrettyTable <https://code.google.com/p/prettytable/>`_ . :target: https://coveralls.io/github/kxxoling/PTable?branch=master :alt: Coverage -.. image:: https://img.shields.io/pypi/dm/PTable.svg?maxAge=2592000 - :target: https://pypi.python.org/pypi/PTable/ - :alt: Downloads - Installation ============ -As PTable is a fork of PrettyTable, and compatible to all its APIs, +As PTable is a fork of PrettyTable, and compatible with all its APIs, so PTable is usage is the same as PrettyTable, and the installation would cover on the original PrettyTable. As always, you can install PTable in 3 ways. -Via pip(recommend):: +Via pip (recommend):: pip install PTable @@ -62,7 +58,7 @@ PTable library API is almost as PrettyTable, you can import the same API from from prettytable import PrettyTable x = PrettyTable() -A better hosted document is hosted on `ReadTheDocument <http://ptable.readthedocs.org/>`_ . +A better hosted document is hosted on `ReadTheDocument <http://ptable.readthedocs.org/>`_. As command-line tool @@ -74,7 +70,7 @@ This is an original function of PTable, can be used as ``ptable`` command: ptable --csv somefile.csv -or a unix style pipe: +or a Unix style pipe: .. code-block:: shell diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 961d3c4..b8996c9 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -389,7 +389,7 @@ in-built styles you can use for your tables: - ``DEFAULT`` - The default look, used to undo any style changes you may have made -- ``PLAIN_COLUMN`` - A borderless style that works well with command +- ``PLAIN_COLUMNS`` - A borderless style that works well with command line programs for columnar data Other styles are likely to appear in future releases. diff --git a/prettytable/__init__.py b/prettytable/__init__.py index ac2cb37..bef5807 100644 --- a/prettytable/__init__.py +++ b/prettytable/__init__.py @@ -33,5 +33,5 @@ __version__ = "0.9.2" from .prettytable import PrettyTable -from .prettytable import ALL, HEADER, MSWORD_FRIENDLY, NONE +from .prettytable import ALL, HEADER, MSWORD_FRIENDLY, NONE, PLAIN_COLUMNS from .factory import from_csv, from_db_cursor, from_html, from_html_one diff --git a/prettytable/prettytable.py b/prettytable/prettytable.py index 96b94bf..02dab66 100644 --- a/prettytable/prettytable.py +++ b/prettytable/prettytable.py @@ -302,7 +302,7 @@ class PrettyTable(object): try: assert int(val) >= 0 except AssertionError: - raise Exception("Invalid value for %s: %s!" % (name, self._unicode(val))) + raise Exception("Invalid value for {}: {}!".format(name, self._unicode(val))) def _validate_true_or_false(self, name, val): try: @@ -1499,7 +1499,7 @@ class PrettyTable(object): open_tag.append("<table") if options["attributes"]: for attr_name in options["attributes"]: - open_tag.append(" %s=\"%s\"" % (attr_name, options["attributes"][attr_name])) + open_tag.append(" {}=\"{}\"".format(attr_name, options["attributes"][attr_name])) open_tag.append(">") lines.append("".join(open_tag)) @@ -1566,7 +1566,7 @@ class PrettyTable(object): open_tag.append(" frame=\"vsides\" rules=\"cols\"") if options["attributes"]: for attr_name in options["attributes"]: - open_tag.append(" %s=\"%s\"" % (attr_name, options["attributes"][attr_name])) + open_tag.append(" {}=\"{}\"".format(attr_name, options["attributes"][attr_name])) open_tag.append(">") lines.append("".join(open_tag)) @@ -20,11 +20,14 @@ setup( }, classifiers=[ 'Programming Language :: Python', - 'Programming Language :: Python :: 2.4', - 'Programming Language :: Python :: 2.5', - 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: Implementation :: CPython', 'License :: OSI Approved :: BSD License', 'Topic :: Text Processing' ], |