Hello community,
here is the log from the commit of package python-texttable for
openSUSE:Factory checked in at 2019-02-19 11:57:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-texttable (Old)
and /work/SRC/openSUSE:Factory/.python-texttable.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-texttable"
Tue Feb 19 11:57:58 2019 rev:4 rq:676533 version:1.6.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-texttable/python-texttable.changes
2018-07-21 10:25:37.770951533 +0200
+++
/work/SRC/openSUSE:Factory/.python-texttable.new.28833/python-texttable.changes
2019-02-19 11:58:03.381213168 +0100
@@ -1,0 +2,19 @@
+Fri Feb 15 12:46:31 UTC 2019 - John Vandenberg <[email protected]>
+
+- Update to 1.6.1
+ * Packaging fixes only
+
+-------------------------------------------------------------------
+Fri Feb 15 01:35:10 UTC 2019 - John Vandenberg <[email protected]>
+
+- Update to 1.6.0
+ * Added texttable.pyi
+ * Added missing set_header_align method stub
+ * Allow chaining of method calls
+ * Replace distutils with setuptools
+ * Create a method for redefining the max_width
+ * Switch to MIT License
+ * Use wcwidth if available for better rendering (basic emoji support)
+ * Update README.md
+
+-------------------------------------------------------------------
Old:
----
texttable-1.4.0.tar.gz
New:
----
texttable-1.6.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-texttable.spec ++++++
--- /var/tmp/diff_new_pack.So0f62/_old 2019-02-19 11:58:08.381210479 +0100
+++ /var/tmp/diff_new_pack.So0f62/_new 2019-02-19 11:58:08.385210477 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-texttable
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,25 +12,26 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-texttable
-Version: 1.4.0
+Version: 1.6.1
Release: 0
Summary: Module for creating simple ASCII tables
-License: LGPL-3.0-only
+License: MIT
Group: Development/Languages/Python
-Url: https://github.com/foutaise/texttable/
+URL: https://github.com/foutaise/texttable/
Source:
https://files.pythonhosted.org/packages/source/t/texttable/texttable-%{version}.tar.gz
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
+Requires: python-base
+Recommends: python-wcwidth
BuildArch: noarch
-
%python_subpackages
%description
@@ -52,7 +53,7 @@
%files %{python_files}
%license LICENSE
-%doc README.md
+%doc README.md CHANGELOG.md
%{python_sitelib}/*
%changelog
++++++ texttable-1.4.0.tar.gz -> texttable-1.6.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/.gitignore
new/texttable-1.6.1/.gitignore
--- old/texttable-1.4.0/.gitignore 2018-06-22 16:17:48.000000000 +0200
+++ new/texttable-1.6.1/.gitignore 1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-/.cache/
-/.coverage
-/.tox/
-/MANIFEST
-/__pycache__/
-*.egg-info/
-*.pyc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/CHANGELOG.md
new/texttable-1.6.1/CHANGELOG.md
--- old/texttable-1.4.0/CHANGELOG.md 1970-01-01 01:00:00.000000000 +0100
+++ new/texttable-1.6.1/CHANGELOG.md 2019-02-15 11:16:42.000000000 +0100
@@ -0,0 +1,38 @@
+# Version History
+
+v1.6.1 (2019-02-15)
+* Include tests, license in source tarball
(https://github.com/foutaise/texttable/issues/58)
+* Add changelog
+
+v1.6.0 (2019-01-17)
+* Add basic emoji support (https://github.com/foutaise/texttable/issues/55)
+
+v1.5.0 (2018-11-02)
+* Create a method for redefining the max_width
(https://github.com/foutaise/texttable/issues/54)
+* Use setuptools instead of distutils to upload metadata to PyPI
(https://github.com/foutaise/texttable/issues/49)
+* Switch to MIT license
+
+v1.4.0 (2018-06-22)
+* Add set_header_align() method
(https://github.com/foutaise/texttable/issues/45)
+
+v1.3.1 (2018-06-12)
+* Fix missing textwrapper command when cjkwrap is not used
(https://github.com/foutaise/texttable/issues/43)
+
+v1.3.0 (2018-06-11)
+* Remove redundant code for unsupported/EOL Python
(https://github.com/foutaise/texttable/pull/31)
+
+v1.2.1 (2018-01-03)
+* Use test_cjkwrap only when cjkwrap is available
(https://github.com/foutaise/texttable/issues/35)
+
+v1.2.0 (2018-01-03)
+* Use cjkwrap for better CJK text support
(https://github.com/foutaise/texttable/issues/34)
+
+v1.1.1 (2017-10-26)
+* Fallback to text on TypeError
(https://github.com/foutaise/texttable/issues/28)
+
+v1.1.0 (2017-10-22)
+* Easier formatting, allow callable as a column datatype (PR
https://github.com/foutaise/texttable/pull/27)
+
+v1.0.0 (2017-10-14)
+* fix bug in wide chars handling
(https://github.com/foutaise/texttable/issues/9)
+* avoid use of sys.version to obtain Python version
(https://github.com/foutaise/texttable/pull/24)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/LICENSE new/texttable-1.6.1/LICENSE
--- old/texttable-1.4.0/LICENSE 2018-06-22 16:17:48.000000000 +0200
+++ new/texttable-1.6.1/LICENSE 2019-02-15 07:13:58.000000000 +0100
@@ -1,165 +1,22 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
+The MIT License (MIT)
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
+Copyright (c) 2018 Gerome Fournier
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/MANIFEST.in
new/texttable-1.6.1/MANIFEST.in
--- old/texttable-1.4.0/MANIFEST.in 2018-06-22 16:17:48.000000000 +0200
+++ new/texttable-1.6.1/MANIFEST.in 2019-02-15 11:13:55.000000000 +0100
@@ -1 +1,8 @@
-include README.md
+include *.md
+include *.py
+include *.pyi
+include LICENSE
+include tox.ini
+include .coveragerc
+
+global-exclude *.pyc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/PKG-INFO new/texttable-1.6.1/PKG-INFO
--- old/texttable-1.4.0/PKG-INFO 2018-06-22 16:17:48.000000000 +0200
+++ new/texttable-1.6.1/PKG-INFO 2019-02-15 11:23:50.000000000 +0100
@@ -1,28 +1,284 @@
-Metadata-Version: 1.0
+Metadata-Version: 2.1
Name: texttable
-Version: 1.4.0
+Version: 1.6.1
Summary: module for creating simple ASCII tables
Home-page: https://github.com/foutaise/texttable/
Author: Gerome Fournier
Author-email: [email protected]
-License: LGPL
-Download-URL: https://github.com/foutaise/texttable/archive/v1.4.0.tar.gz
-Description: texttable is a module to generate a formatted text table, using
ASCII
- characters.
+License: MIT
+Download-URL: https://github.com/foutaise/texttable/archive/v1.6.1.tar.gz
+Description: # texttable
+
+ Python module for creating simple ASCII tables
+
+ ## Availability
+
+ This module is available on
[PyPI](https://pypi.org/project/texttable/), and has been packaged for several
Linux/Unix platforms
+
([Debian](https://packages.debian.org/search?&searchon=names&keywords=python-texttable+),
+
[FreeBSD](https://www.freebsd.org/cgi/ports.cgi?query=texttable&stype=all),
Fedora, Suse...).
+
+ ## Dependencies
+
+ If available, [cjkwrap](https://github.com/fgallaire/cjkwrap) library
is used instead of textwrap, for a better wrapping of CJK text.
+
+ If available, [wcwidth](https://github.com/jquast/wcwidth) library is
used for a better rendering (basic emoji support).
+
+ ## Documentation
+
+ ```
+ NAME
+ texttable - module for creating simple ASCII tables
+
+ FILE
+ /usr/local/lib/python2.7/dist-packages/texttable.py
+
+ DESCRIPTION
+
+ Example:
+
+ table = Texttable()
+ table.set_cols_align(["l", "r", "c"])
+ table.set_cols_valign(["t", "m", "b"])
+ table.add_rows([["Name", "Age", "Nickname"],
+ ["Mr\nXavier\nHuon", 32, "Xav'"],
+ ["Mr\nBaptiste\nClement", 1, "Baby"],
+ ["Mme\nLouise\nBourgeau", 28, "Lou\n\nLoue"]])
+ print table.draw() + "\n"
+
+ table = Texttable()
+ table.set_deco(Texttable.HEADER)
+ table.set_cols_dtype(['t', # text
+ 'f', # float (decimal)
+ 'e', # float (exponent)
+ 'i', # integer
+ 'a']) # automatic
+ table.set_cols_align(["l", "r", "r", "r", "l"])
+ table.add_rows([["text", "float", "exp", "int", "auto"],
+ ["abcd", "67", 654, 89, 128.001],
+ ["efghijk", 67.5434, .654, 89.6,
12800000000000000000000.00023],
+ ["lmn", 5e-78, 5e-78, 89.4,
.000000000000128],
+ ["opqrstu", .023, 5e+78, 92.,
12800000000000000000000]])
+ print table.draw()
+
+ Result:
+
+ +----------+-----+----------+
+ | Name | Age | Nickname |
+ +==========+=====+==========+
+ | Mr | | |
+ | Xavier | 32 | |
+ | Huon | | Xav' |
+ +----------+-----+----------+
+ | Mr | | |
+ | Baptiste | 1 | |
+ | Clement | | Baby |
+ +----------+-----+----------+
+ | Mme | | Lou |
+ | Louise | 28 | |
+ | Bourgeau | | Loue |
+ +----------+-----+----------+
+
+ text float exp int auto
+ ==============================================
+ abcd 67.000 6.540e+02 89 128.001
+ efghijk 67.543 6.540e-01 90 1.280e+22
+ lmn 0.000 5.000e-78 89 0.000
+ opqrstu 0.023 5.000e+78 92 1.280e+22
+
+ CLASSES
+ class Texttable
+ | Methods defined here:
+ |
+ | __init__(self, max_width=80)
+ | Constructor
+ |
+ | - max_width is an integer, specifying the maximum width of
the table
+ | - if set to 0, size is unlimited, therefore cells won't be
wrapped
+ |
+ | add_row(self, array)
+ | Add a row in the rows stack
+ |
+ | - cells can contain newlines and tabs
+ |
+ | add_rows(self, rows, header=True)
+ | Add several rows in the rows stack
+ |
+ | - The 'rows' argument can be either an iterator returning
arrays,
+ | or a by-dimensional array
+ | - 'header' specifies if the first row should be used as
the header
+ | of the table
+ |
+ | draw(self)
+ | Draw the table
+ |
+ | - the table is returned as a whole string
+ |
+ | header(self, array)
+ | Specify the header of the table
+ |
+ | reset(self)
+ | Reset the instance
+ |
+ | - reset rows and header
+ |
+ | set_chars(self, array)
+ | Set the characters used to draw lines between rows and
columns
+ |
+ | - the array should contain 4 fields:
+ |
+ | [horizontal, vertical, corner, header]
+ |
+ | - default is set to:
+ |
+ | ['-', '|', '+', '=']
+ |
+ | set_cols_align(self, array)
+ | Set the desired columns alignment
+ |
+ | - the elements of the array should be either "l", "c" or
"r":
+ |
+ | * "l": column flushed left
+ | * "c": column centered
+ | * "r": column flushed right
+ |
+ | set_cols_dtype(self, array)
+ | Set the desired columns datatype for the cols.
+ |
+ | - the elements of the array should be either a callable or
any of
+ | "a", "t", "f", "e" or "i":
+ |
+ | * "a": automatic (try to use the most appropriate
datatype)
+ | * "t": treat as text
+ | * "f": treat as float in decimal format
+ | * "e": treat as float in exponential format
+ | * "i": treat as int
+ | * a callable: should return formatted string for any
value given
+ |
+ | - by default, automatic datatyping is used for each column
+ |
+ | set_cols_valign(self, array)
+ | Set the desired columns vertical alignment
+ |
+ | - the elements of the array should be either "t", "m" or
"b":
+ |
+ | * "t": column aligned on the top of the cell
+ | * "m": column aligned on the middle of the cell
+ | * "b": column aligned on the bottom of the cell
+ |
+ | set_cols_width(self, array)
+ | Set the desired columns width
+ |
+ | - the elements of the array should be integers, specifying
the
+ | width of each column. For example:
+ |
+ | [10, 20, 5]
+ |
+ | set_deco(self, deco)
+ | Set the table decoration
+ |
+ | - 'deco' can be a combinaison of:
+ |
+ | Texttable.BORDER: Border around the table
+ | Texttable.HEADER: Horizontal line below the header
+ | Texttable.HLINES: Horizontal lines between rows
+ | Texttable.VLINES: Vertical lines between columns
+ |
+ | All of them are enabled by default
+ |
+ | - example:
+ |
+ | Texttable.BORDER | Texttable.HEADER
+ |
+ | set_header_align(self, array)
+ | Set the desired header alignment
+ |
+ | - the elements of the array should be either "l", "c" or
"r":
+ |
+ | * "l": column flushed left
+ | * "c": column centered
+ | * "r": column flushed right
+ |
+ | set_max_width(self, max_width)
+ | Set the maximum width of the table
+ |
+ | - max_width is an integer, specifying the maximum width of
the table
+ | - if set to 0, size is unlimited, therefore cells won't be
wrapped
+ |
+ | set_precision(self, width)
+ | Set the desired precision for float/exponential formats
+ |
+ | - width must be an integer >= 0
+ |
+ | - default value is set to 3
+ |
+ |
----------------------------------------------------------------------
+ | Data and other attributes defined here:
+ |
+ | BORDER = 1
+ |
+ | HEADER = 2
+ |
+ | HLINES = 4
+ |
+ | VLINES = 8
+
+ DATA
+ __all__ = ['Texttable', 'ArraySizeError']
+ __author__ = 'Gerome Fournier <jef(at)foutaise.org>'
+ __credits__ = 'Jeff Kowalczyk:\n - textwrap improved import\n
...at...
+ __license__ = 'MIT'
+ __version__ = '1.6.1'
+
+ VERSION
+ 1.6.1
+
+ AUTHOR
+ Gerome Fournier <jef(at)foutaise.org>
+
+ CREDITS
+ Jeff Kowalczyk:
+ - textwrap improved import
+ - comment concerning header output
+
+ Anonymous:
+ - add_rows method, for adding rows in one go
+
+ Sergey Simonenko:
+ - redefined len() function to deal with non-ASCII characters
+
+ Roger Lew:
+ - columns datatype specifications
+
+ Brian Peterson:
+ - better handling of unicode errors
+
+ Frank Sachsenheim:
+ - add Python 2/3-compatibility
+
+ Maximilian Hils:
+ - fix minor bug for Python 3 compatibility
+
+ frinkelpi:
+ - preserve empty lines
+ ```
+
Platform: any
-Classifier: Development Status :: 4 - Beta
+Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
-Classifier: License :: OSI Approved :: GNU Library or Lesser General Public
License (LGPL)
+Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Classifier: Topic :: Text Processing
+Classifier: Topic :: Utilities
+Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Classifier: Topic :: Text Processing
-Classifier: Topic :: Utilities
+Classifier: Programming Language :: Python :: 3.7
+Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/README.md
new/texttable-1.6.1/README.md
--- old/texttable-1.4.0/README.md 2018-06-22 16:17:48.000000000 +0200
+++ new/texttable-1.6.1/README.md 2019-02-15 07:13:58.000000000 +0100
@@ -4,7 +4,7 @@
## Availability
-This module is available on
[PypI](https://pypi.python.org/pypi/texttable/1.4.0), and has been packaged for
several Linux/Unix platforms
+This module is available on [PyPI](https://pypi.org/project/texttable/), and
has been packaged for several Linux/Unix platforms
([Debian](https://packages.debian.org/search?&searchon=names&keywords=python-texttable+),
[FreeBSD](https://www.freebsd.org/cgi/ports.cgi?query=texttable&stype=all),
Fedora, Suse...).
@@ -12,6 +12,8 @@
If available, [cjkwrap](https://github.com/fgallaire/cjkwrap) library is used
instead of textwrap, for a better wrapping of CJK text.
+If available, [wcwidth](https://github.com/jquast/wcwidth) library is used for
a better rendering (basic emoji support).
+
## Documentation
```
@@ -187,6 +189,12 @@
| * "c": column centered
| * "r": column flushed right
|
+ | set_max_width(self, max_width)
+ | Set the maximum width of the table
+ |
+ | - max_width is an integer, specifying the maximum width of the
table
+ | - if set to 0, size is unlimited, therefore cells won't be wrapped
+ |
| set_precision(self, width)
| Set the desired precision for float/exponential formats
|
@@ -209,11 +217,11 @@
__all__ = ['Texttable', 'ArraySizeError']
__author__ = 'Gerome Fournier <jef(at)foutaise.org>'
__credits__ = 'Jeff Kowalczyk:\n - textwrap improved import\n ...at...
- __license__ = 'LGPL'
- __version__ = '1.4.0'
+ __license__ = 'MIT'
+ __version__ = '1.6.1'
VERSION
- 1.4.0
+ 1.6.1
AUTHOR
Gerome Fournier <jef(at)foutaise.org>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/setup.cfg
new/texttable-1.6.1/setup.cfg
--- old/texttable-1.4.0/setup.cfg 1970-01-01 01:00:00.000000000 +0100
+++ new/texttable-1.6.1/setup.cfg 2019-02-15 11:23:50.000000000 +0100
@@ -0,0 +1,4 @@
+[egg_info]
+tag_build =
+tag_date = 0
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/setup.py new/texttable-1.6.1/setup.py
--- old/texttable-1.4.0/setup.py 2018-06-22 16:17:48.000000000 +0200
+++ new/texttable-1.6.1/setup.py 2019-02-15 07:13:58.000000000 +0100
@@ -1,49 +1,34 @@
#!/usr/bin/env python
#
# texttable - module for creating simple ASCII tables
-# Copyright (C) 2003-2015 Gerome Fournier <jef(at)foutaise.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+# Copyright (C) 2003-2018 Gerome Fournier <jef(at)foutaise.org>
+
+from setuptools import setup
DESCRIPTION = "module for creating simple ASCII tables"
with open("README.md") as f:
LONG_DESCRIPTION = f.read()
-import sys
-
-from distutils.core import setup
setup(
- name = "texttable",
- version = "1.4.0",
- author = "Gerome Fournier",
- author_email = "[email protected]",
- url = "https://github.com/foutaise/texttable/",
- download_url =
"https://github.com/foutaise/texttable/archive/v1.4.0.tar.gz",
- license = "LGPL",
- py_modules = ["texttable"],
- description = DESCRIPTION,
- long_description = LONG_DESCRIPTION,
+ name="texttable",
+ version="1.6.1",
+ author="Gerome Fournier",
+ author_email="[email protected]",
+ url="https://github.com/foutaise/texttable/",
+ download_url="https://github.com/foutaise/texttable/archive/v1.6.1.tar.gz",
+ license="MIT",
+ py_modules=["texttable"],
+ description=DESCRIPTION,
+ long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
- platforms = "any",
- classifiers = [
- 'Development Status :: 4 - Beta',
+ platforms="any",
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
- 'License :: OSI Approved :: GNU Library or Lesser General Public
License (LGPL)',
+ 'License :: OSI Approved :: MIT License',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: MacOS',
@@ -56,5 +41,6 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
]
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/tests.py new/texttable-1.6.1/tests.py
--- old/texttable-1.4.0/tests.py 2018-06-22 16:17:48.000000000 +0200
+++ new/texttable-1.6.1/tests.py 2019-02-15 07:13:58.000000000 +0100
@@ -121,6 +121,44 @@
+----+-------+
''')
+def test_exceeding_max_width3():
+ table = Texttable()
+ table.set_max_width(35)
+ table.set_deco(Texttable.HEADER)
+ table.add_rows([
+ ["key", "value"],
+ [1, "a"],
+ [2, "b"],
+ [3, "very long, very long, very long"],
+ ])
+ assert clean(table.draw()) == dedent('''\
+ key value
+ ===================================
+ 1 a
+ 2 b
+ 3 very long, very long, very
+ long
+ ''')
+
+def test_exceeding_max_width4():
+ table = Texttable()
+ table.set_max_width(14)
+ table.add_rows([
+ ["a", "b"],
+ [1, "+"],
+ [22, "++++++++"],
+ ])
+ assert clean(table.draw()) == dedent('''\
+ +----+-------+
+ | a | b |
+ +====+=======+
+ | 1 | + |
+ +----+-------+
+ | 22 | +++++ |
+ | | +++ |
+ +----+-------+
+ ''')
+
def test_obj2unicode():
table = Texttable()
table.set_deco(Texttable.HEADER)
@@ -217,3 +255,36 @@
''')
except ImportError:
True
+
+def test_chaining():
+ table = Texttable()
+ table.reset()
+ table.set_max_width(50)
+ table.set_chars(list('-|+='))
+ table.set_deco(Texttable.BORDER)
+ table.set_header_align(list('lll'))
+ table.set_cols_align(list('lll'))
+ table.set_cols_valign(list('mmm'))
+ table.set_cols_dtype(list('ttt'))
+ table.set_cols_width([3, 3, 3])
+ table.set_precision(3)
+ table.header(list('abc'))
+ table.add_row(list('def'))
+ table.add_rows([list('ghi')], False)
+ s1 = table.draw()
+ s2 = (Texttable()
+ .reset()
+ .set_max_width(50)
+ .set_chars(list('-|+='))
+ .set_deco(Texttable.BORDER)
+ .set_header_align(list('lll'))
+ .set_cols_align(list('lll'))
+ .set_cols_valign(list('mmm'))
+ .set_cols_dtype(list('ttt'))
+ .set_cols_width([3, 3, 3])
+ .set_precision(3)
+ .header(list('abc'))
+ .add_row(list('def'))
+ .add_rows([list('ghi')], False)
+ .draw())
+ assert s1 == s2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/texttable.egg-info/PKG-INFO
new/texttable-1.6.1/texttable.egg-info/PKG-INFO
--- old/texttable-1.4.0/texttable.egg-info/PKG-INFO 1970-01-01
01:00:00.000000000 +0100
+++ new/texttable-1.6.1/texttable.egg-info/PKG-INFO 2019-02-15
11:23:50.000000000 +0100
@@ -0,0 +1,284 @@
+Metadata-Version: 2.1
+Name: texttable
+Version: 1.6.1
+Summary: module for creating simple ASCII tables
+Home-page: https://github.com/foutaise/texttable/
+Author: Gerome Fournier
+Author-email: [email protected]
+License: MIT
+Download-URL: https://github.com/foutaise/texttable/archive/v1.6.1.tar.gz
+Description: # texttable
+
+ Python module for creating simple ASCII tables
+
+ ## Availability
+
+ This module is available on
[PyPI](https://pypi.org/project/texttable/), and has been packaged for several
Linux/Unix platforms
+
([Debian](https://packages.debian.org/search?&searchon=names&keywords=python-texttable+),
+
[FreeBSD](https://www.freebsd.org/cgi/ports.cgi?query=texttable&stype=all),
Fedora, Suse...).
+
+ ## Dependencies
+
+ If available, [cjkwrap](https://github.com/fgallaire/cjkwrap) library
is used instead of textwrap, for a better wrapping of CJK text.
+
+ If available, [wcwidth](https://github.com/jquast/wcwidth) library is
used for a better rendering (basic emoji support).
+
+ ## Documentation
+
+ ```
+ NAME
+ texttable - module for creating simple ASCII tables
+
+ FILE
+ /usr/local/lib/python2.7/dist-packages/texttable.py
+
+ DESCRIPTION
+
+ Example:
+
+ table = Texttable()
+ table.set_cols_align(["l", "r", "c"])
+ table.set_cols_valign(["t", "m", "b"])
+ table.add_rows([["Name", "Age", "Nickname"],
+ ["Mr\nXavier\nHuon", 32, "Xav'"],
+ ["Mr\nBaptiste\nClement", 1, "Baby"],
+ ["Mme\nLouise\nBourgeau", 28, "Lou\n\nLoue"]])
+ print table.draw() + "\n"
+
+ table = Texttable()
+ table.set_deco(Texttable.HEADER)
+ table.set_cols_dtype(['t', # text
+ 'f', # float (decimal)
+ 'e', # float (exponent)
+ 'i', # integer
+ 'a']) # automatic
+ table.set_cols_align(["l", "r", "r", "r", "l"])
+ table.add_rows([["text", "float", "exp", "int", "auto"],
+ ["abcd", "67", 654, 89, 128.001],
+ ["efghijk", 67.5434, .654, 89.6,
12800000000000000000000.00023],
+ ["lmn", 5e-78, 5e-78, 89.4,
.000000000000128],
+ ["opqrstu", .023, 5e+78, 92.,
12800000000000000000000]])
+ print table.draw()
+
+ Result:
+
+ +----------+-----+----------+
+ | Name | Age | Nickname |
+ +==========+=====+==========+
+ | Mr | | |
+ | Xavier | 32 | |
+ | Huon | | Xav' |
+ +----------+-----+----------+
+ | Mr | | |
+ | Baptiste | 1 | |
+ | Clement | | Baby |
+ +----------+-----+----------+
+ | Mme | | Lou |
+ | Louise | 28 | |
+ | Bourgeau | | Loue |
+ +----------+-----+----------+
+
+ text float exp int auto
+ ==============================================
+ abcd 67.000 6.540e+02 89 128.001
+ efghijk 67.543 6.540e-01 90 1.280e+22
+ lmn 0.000 5.000e-78 89 0.000
+ opqrstu 0.023 5.000e+78 92 1.280e+22
+
+ CLASSES
+ class Texttable
+ | Methods defined here:
+ |
+ | __init__(self, max_width=80)
+ | Constructor
+ |
+ | - max_width is an integer, specifying the maximum width of
the table
+ | - if set to 0, size is unlimited, therefore cells won't be
wrapped
+ |
+ | add_row(self, array)
+ | Add a row in the rows stack
+ |
+ | - cells can contain newlines and tabs
+ |
+ | add_rows(self, rows, header=True)
+ | Add several rows in the rows stack
+ |
+ | - The 'rows' argument can be either an iterator returning
arrays,
+ | or a by-dimensional array
+ | - 'header' specifies if the first row should be used as
the header
+ | of the table
+ |
+ | draw(self)
+ | Draw the table
+ |
+ | - the table is returned as a whole string
+ |
+ | header(self, array)
+ | Specify the header of the table
+ |
+ | reset(self)
+ | Reset the instance
+ |
+ | - reset rows and header
+ |
+ | set_chars(self, array)
+ | Set the characters used to draw lines between rows and
columns
+ |
+ | - the array should contain 4 fields:
+ |
+ | [horizontal, vertical, corner, header]
+ |
+ | - default is set to:
+ |
+ | ['-', '|', '+', '=']
+ |
+ | set_cols_align(self, array)
+ | Set the desired columns alignment
+ |
+ | - the elements of the array should be either "l", "c" or
"r":
+ |
+ | * "l": column flushed left
+ | * "c": column centered
+ | * "r": column flushed right
+ |
+ | set_cols_dtype(self, array)
+ | Set the desired columns datatype for the cols.
+ |
+ | - the elements of the array should be either a callable or
any of
+ | "a", "t", "f", "e" or "i":
+ |
+ | * "a": automatic (try to use the most appropriate
datatype)
+ | * "t": treat as text
+ | * "f": treat as float in decimal format
+ | * "e": treat as float in exponential format
+ | * "i": treat as int
+ | * a callable: should return formatted string for any
value given
+ |
+ | - by default, automatic datatyping is used for each column
+ |
+ | set_cols_valign(self, array)
+ | Set the desired columns vertical alignment
+ |
+ | - the elements of the array should be either "t", "m" or
"b":
+ |
+ | * "t": column aligned on the top of the cell
+ | * "m": column aligned on the middle of the cell
+ | * "b": column aligned on the bottom of the cell
+ |
+ | set_cols_width(self, array)
+ | Set the desired columns width
+ |
+ | - the elements of the array should be integers, specifying
the
+ | width of each column. For example:
+ |
+ | [10, 20, 5]
+ |
+ | set_deco(self, deco)
+ | Set the table decoration
+ |
+ | - 'deco' can be a combinaison of:
+ |
+ | Texttable.BORDER: Border around the table
+ | Texttable.HEADER: Horizontal line below the header
+ | Texttable.HLINES: Horizontal lines between rows
+ | Texttable.VLINES: Vertical lines between columns
+ |
+ | All of them are enabled by default
+ |
+ | - example:
+ |
+ | Texttable.BORDER | Texttable.HEADER
+ |
+ | set_header_align(self, array)
+ | Set the desired header alignment
+ |
+ | - the elements of the array should be either "l", "c" or
"r":
+ |
+ | * "l": column flushed left
+ | * "c": column centered
+ | * "r": column flushed right
+ |
+ | set_max_width(self, max_width)
+ | Set the maximum width of the table
+ |
+ | - max_width is an integer, specifying the maximum width of
the table
+ | - if set to 0, size is unlimited, therefore cells won't be
wrapped
+ |
+ | set_precision(self, width)
+ | Set the desired precision for float/exponential formats
+ |
+ | - width must be an integer >= 0
+ |
+ | - default value is set to 3
+ |
+ |
----------------------------------------------------------------------
+ | Data and other attributes defined here:
+ |
+ | BORDER = 1
+ |
+ | HEADER = 2
+ |
+ | HLINES = 4
+ |
+ | VLINES = 8
+
+ DATA
+ __all__ = ['Texttable', 'ArraySizeError']
+ __author__ = 'Gerome Fournier <jef(at)foutaise.org>'
+ __credits__ = 'Jeff Kowalczyk:\n - textwrap improved import\n
...at...
+ __license__ = 'MIT'
+ __version__ = '1.6.1'
+
+ VERSION
+ 1.6.1
+
+ AUTHOR
+ Gerome Fournier <jef(at)foutaise.org>
+
+ CREDITS
+ Jeff Kowalczyk:
+ - textwrap improved import
+ - comment concerning header output
+
+ Anonymous:
+ - add_rows method, for adding rows in one go
+
+ Sergey Simonenko:
+ - redefined len() function to deal with non-ASCII characters
+
+ Roger Lew:
+ - columns datatype specifications
+
+ Brian Peterson:
+ - better handling of unicode errors
+
+ Frank Sachsenheim:
+ - add Python 2/3-compatibility
+
+ Maximilian Hils:
+ - fix minor bug for Python 3 compatibility
+
+ frinkelpi:
+ - preserve empty lines
+ ```
+
+Platform: any
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Environment :: Console
+Classifier: Intended Audience :: Developers
+Classifier: Intended Audience :: End Users/Desktop
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: POSIX
+Classifier: Operating System :: MacOS
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Classifier: Topic :: Text Processing
+Classifier: Topic :: Utilities
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/texttable.egg-info/SOURCES.txt
new/texttable-1.6.1/texttable.egg-info/SOURCES.txt
--- old/texttable-1.4.0/texttable.egg-info/SOURCES.txt 1970-01-01
01:00:00.000000000 +0100
+++ new/texttable-1.6.1/texttable.egg-info/SOURCES.txt 2019-02-15
11:23:50.000000000 +0100
@@ -0,0 +1,14 @@
+.coveragerc
+CHANGELOG.md
+LICENSE
+MANIFEST.in
+README.md
+setup.py
+tests.py
+texttable.py
+texttable.pyi
+tox.ini
+texttable.egg-info/PKG-INFO
+texttable.egg-info/SOURCES.txt
+texttable.egg-info/dependency_links.txt
+texttable.egg-info/top_level.txt
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/texttable-1.4.0/texttable.egg-info/dependency_links.txt
new/texttable-1.6.1/texttable.egg-info/dependency_links.txt
--- old/texttable-1.4.0/texttable.egg-info/dependency_links.txt 1970-01-01
01:00:00.000000000 +0100
+++ new/texttable-1.6.1/texttable.egg-info/dependency_links.txt 2019-02-15
11:23:50.000000000 +0100
@@ -0,0 +1 @@
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/texttable.egg-info/top_level.txt
new/texttable-1.6.1/texttable.egg-info/top_level.txt
--- old/texttable-1.4.0/texttable.egg-info/top_level.txt 1970-01-01
01:00:00.000000000 +0100
+++ new/texttable-1.6.1/texttable.egg-info/top_level.txt 2019-02-15
11:23:50.000000000 +0100
@@ -0,0 +1 @@
+texttable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/texttable.py
new/texttable-1.6.1/texttable.py
--- old/texttable-1.4.0/texttable.py 2018-06-22 16:17:48.000000000 +0200
+++ new/texttable-1.6.1/texttable.py 2019-02-15 07:13:58.000000000 +0100
@@ -1,19 +1,5 @@
# texttable - module for creating simple ASCII tables
-# Copyright (C) 2003-2015 Gerome Fournier <jef(at)foutaise.org>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+# Copyright (C) 2003-2018 Gerome Fournier <jef(at)foutaise.org>
"""module for creating simple ASCII tables
@@ -75,8 +61,8 @@
__all__ = ["Texttable", "ArraySizeError"]
__author__ = 'Gerome Fournier <jef(at)foutaise.org>'
-__license__ = 'LGPL'
-__version__ = '1.4.0'
+__license__ = 'MIT'
+__version__ = '1.6.1'
__credits__ = """\
Jeff Kowalczyk:
- textwrap improved import
@@ -124,6 +110,26 @@
sys.stderr.write("Can't import textwrap module!\n")
raise
+# define a function to calculate the rendering width of a unicode character
+# - use wcwidth if available
+# - fallback to unicodedata information otherwise
+try:
+ import wcwidth
+ def uchar_width(c):
+ """Return the rendering width of a unicode character
+ """
+ return max(0, wcwidth.wcwidth(c))
+except ImportError:
+ def uchar_width(c):
+ """Return the rendering width of a unicode character
+ """
+ if unicodedata.east_asian_width(c) in 'WF':
+ return 2
+ elif unicodedata.combining(c):
+ return 0
+ else:
+ return 1
+
from functools import reduce
if sys.version_info >= (3, 0):
@@ -153,9 +159,7 @@
"""Redefining len here so it will be able to work with non-ASCII characters
"""
if isinstance(iterable, bytes_type) or isinstance(iterable, unicode_type):
- unicode_data = obj2unicode(iterable)
- w = unicodedata.east_asian_width
- return sum([w(c) in 'WF' and 2 or (0 if unicodedata.combining(c) else
1) for c in unicode_data])
+ return sum([uchar_width(c) for c in obj2unicode(iterable)])
else:
return iterable.__len__()
@@ -191,9 +195,7 @@
- if set to 0, size is unlimited, therefore cells won't be wrapped
"""
- if max_width <= 0:
- max_width = False
- self._max_width = max_width
+ self.set_max_width(max_width)
self._precision = 3
self._deco = Texttable.VLINES | Texttable.HLINES | Texttable.BORDER | \
@@ -211,6 +213,16 @@
self._row_size = None
self._header = []
self._rows = []
+ return self
+
+ def set_max_width(self, max_width):
+ """Set the maximum width of the table
+
+ - max_width is an integer, specifying the maximum width of the table
+ - if set to 0, size is unlimited, therefore cells won't be wrapped
+ """
+ self._max_width = max_width if max_width > 0 else False
+ return self
def set_chars(self, array):
"""Set the characters used to draw lines between rows and columns
@@ -229,6 +241,7 @@
array = [ x[:1] for x in [ str(s) for s in array ] ]
(self._char_horiz, self._char_vert,
self._char_corner, self._char_header) = array
+ return self
def set_deco(self, deco):
"""Set the table decoration
@@ -248,6 +261,7 @@
"""
self._deco = deco
+ return self
def set_header_align(self, array):
"""Set the desired header alignment
@@ -261,6 +275,7 @@
self._check_row_size(array)
self._header_align = array
+ return self
def set_cols_align(self, array):
"""Set the desired columns alignment
@@ -274,6 +289,7 @@
self._check_row_size(array)
self._align = array
+ return self
def set_cols_valign(self, array):
"""Set the desired columns vertical alignment
@@ -287,6 +303,7 @@
self._check_row_size(array)
self._valign = array
+ return self
def set_cols_dtype(self, array):
"""Set the desired columns datatype for the cols.
@@ -306,6 +323,7 @@
self._check_row_size(array)
self._dtype = array
+ return self
def set_cols_width(self, array):
"""Set the desired columns width
@@ -325,6 +343,7 @@
sys.stderr.write("Wrong argument in column width specification\n")
raise
self._width = array
+ return self
def set_precision(self, width):
"""Set the desired precision for float/exponential formats
@@ -337,6 +356,7 @@
if not type(width) is int or width < 0:
raise ValueError('width must be an integer greater then 0')
self._precision = width
+ return self
def header(self, array):
"""Specify the header of the table
@@ -344,6 +364,7 @@
self._check_row_size(array)
self._header = list(map(obj2unicode, array))
+ return self
def add_row(self, array):
"""Add a row in the rows stack
@@ -360,6 +381,7 @@
for i, x in enumerate(array):
cells.append(self._str(i, x))
self._rows.append(cells)
+ return self
def add_rows(self, rows, header=True):
"""Add several rows in the rows stack
@@ -380,6 +402,7 @@
rows = rows[1:]
for row in rows:
self.add_row(row)
+ return self
def draw(self):
"""Draw the table
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/texttable.pyi
new/texttable-1.6.1/texttable.pyi
--- old/texttable-1.4.0/texttable.pyi 1970-01-01 01:00:00.000000000 +0100
+++ new/texttable-1.6.1/texttable.pyi 2019-02-15 07:13:58.000000000 +0100
@@ -0,0 +1,38 @@
+from typing import *
+
+class Texttable:
+
+ BORDER: int
+ HEADER: int
+ HLINES: int
+ VLINES: int
+
+ def __init__(self, max_width: int = ...) -> None: ...
+
+ def reset(self) -> 'Texttable': ...
+
+ def set_max_width(self, max_width: int) -> 'Texttable': ...
+
+ def set_chars(self, array: List[str]) -> 'Texttable': ...
+
+ def set_deco(self, deco: int) -> 'Texttable': ...
+
+ def set_header_align(self, array: List[str]) -> 'Texttable': ...
+
+ def set_cols_align(self, array: List[str]) -> 'Texttable': ...
+
+ def set_cols_valign(self, array: List[str]) -> 'Texttable': ...
+
+ def set_cols_dtype(self, array: List[Union[str, Callable[[Any], str]]]) ->
'Texttable': ...
+
+ def set_cols_width(self, array: List[int]) -> 'Texttable': ...
+
+ def set_precision(self, width: int) -> 'Texttable': ...
+
+ def header(self, array: List[str]) -> 'Texttable': ...
+
+ def add_row(self, array: List[Union[Union[int, str], float]]) ->
'Texttable': ...
+
+ def add_rows(self, rows: List[object], header: bool = ...) -> 'Texttable':
...
+
+ def draw(self) -> str: ...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/texttable-1.4.0/tox.ini new/texttable-1.6.1/tox.ini
--- old/texttable-1.4.0/tox.ini 2018-06-22 16:17:48.000000000 +0200
+++ new/texttable-1.6.1/tox.ini 2019-02-15 07:13:58.000000000 +0100
@@ -1,5 +1,5 @@
[tox]
-envlist = py27,py34,py35,py36
+envlist = py27,py35,py36,py37
[testenv]
deps =