From 69ab350c49b8c622ed15b54697bec2166fac2e9e67db7fe129cf4be190308b7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 15 Feb 2019 12:53:01 +0000 Subject: [PATCH] Accepting request 676531 from home:jayvdb:pyexcel - Update to 1.6.1 * Packaging fixes only OBS-URL: https://build.opensuse.org/request/show/676531 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-texttable?expand=0&rev=10 --- LICENSE | 22 --- python-texttable.changes | 6 + python-texttable.spec | 7 +- tests.py | 290 --------------------------------------- texttable-1.6.0.tar.gz | 3 - texttable-1.6.1.tar.gz | 3 + 6 files changed, 11 insertions(+), 320 deletions(-) delete mode 100644 LICENSE delete mode 100644 tests.py delete mode 100644 texttable-1.6.0.tar.gz create mode 100644 texttable-1.6.1.tar.gz diff --git a/LICENSE b/LICENSE deleted file mode 100644 index b677982..0000000 --- a/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -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. - diff --git a/python-texttable.changes b/python-texttable.changes index f10228e..26f980a 100644 --- a/python-texttable.changes +++ b/python-texttable.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Feb 15 12:46:31 UTC 2019 - John Vandenberg + +- Update to 1.6.1 + * Packaging fixes only + ------------------------------------------------------------------- Fri Feb 15 01:35:10 UTC 2019 - John Vandenberg diff --git a/python-texttable.spec b/python-texttable.spec index 5c530a7..ef93f9c 100644 --- a/python-texttable.spec +++ b/python-texttable.spec @@ -18,15 +18,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-texttable -Version: 1.6.0 +Version: 1.6.1 Release: 0 Summary: Module for creating simple ASCII tables License: MIT Group: Development/Languages/Python URL: https://github.com/foutaise/texttable/ Source: https://files.pythonhosted.org/packages/source/t/texttable/texttable-%{version}.tar.gz -Source1: https://raw.githubusercontent.com/foutaise/texttable/v%{version}/LICENSE -Source2: https://raw.githubusercontent.com/foutaise/texttable/master/tests.py BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -42,7 +40,6 @@ characters. %prep %setup -q -n texttable-%{version} -cp %{SOURCE1} %{SOURCE2} . %build %python_build @@ -56,7 +53,7 @@ cp %{SOURCE1} %{SOURCE2} . %files %{python_files} %license LICENSE -%doc README.md +%doc README.md CHANGELOG.md %{python_sitelib}/* %changelog diff --git a/tests.py b/tests.py deleted file mode 100644 index 8ef0598..0000000 --- a/tests.py +++ /dev/null @@ -1,290 +0,0 @@ -#coding: utf-8 - -import re -import sys -from textwrap import dedent -from texttable import Texttable - -if sys.version >= '3': - u_dedent = dedent -else: - def u_dedent(b): - return unicode(dedent(b), 'utf-8') - -def clean(text): - return re.sub(r'( +)$', '', text, flags=re.MULTILINE) + '\n' - -def test_texttable(): - 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"], - ]) - assert clean(table.draw()) == dedent('''\ - +----------+-----+----------+ - | Name | Age | Nickname | - +==========+=====+==========+ - | Mr | | | - | Xavier | 32 | | - | Huon | | Xav' | - +----------+-----+----------+ - | Mr | | | - | Baptiste | 1 | | - | Clement | | Baby | - +----------+-----+----------+ - | Mme | | Lou | - | Louise | 28 | | - | Bourgeau | | Loue | - +----------+-----+----------+ - ''') - -def test_texttable_header(): - 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], - ]) - assert clean(table.draw()) == dedent('''\ - 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 - ''') - -def test_set_cols_width(): - table = Texttable() - table.set_deco(Texttable.HEADER) - table.set_cols_width([10, 10]) - table.add_rows([ - ["key", "value"], - [1, "a"], - [2, "b"], - ]) - assert clean(table.draw()) == dedent('''\ - key value - ======================= - 1 a - 2 b - ''') - -def test_exceeding_max_width(): - table = Texttable(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_width2(): - table = Texttable(max_width=14) - table.add_rows([ - ["a", "b"], - [1, "+"], - [22, "++++++++"], - ]) - assert clean(table.draw()) == dedent('''\ - +----+-------+ - | a | b | - +====+=======+ - | 1 | + | - +----+-------+ - | 22 | +++++ | - | | +++ | - +----+-------+ - ''') - -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) - table.add_rows([ - ["key", "value"], - [1, "a"], - [2, 1], - [3, None], - ]) - assert clean(table.draw()) == dedent('''\ - key value - =========== - 1 a - 2 1 - 3 None - ''') - -def test_combining_char(): - table = Texttable() - table.set_cols_align(["l", "r", "r"]) - table.add_rows([ - ["str", "code-point\nlength", "display\nwidth"], - ["ā", 2, 1], - ["a", 1, 1], - ]) - assert clean(table.draw()) == u_dedent('''\ - +-----+------------+---------+ - | str | code-point | display | - | | length | width | - +=====+============+=========+ - | ā | 2 | 1 | - +-----+------------+---------+ - | a | 1 | 1 | - +-----+------------+---------+ - ''') - -def test_combining_char2(): - table = Texttable() - table.add_rows([ - ["a", "b", "c"], - ["诶诶诶", "bbb", "西西西"], - ], False) - assert clean(table.draw()) == u_dedent('''\ - +--------+-----+--------+ - | a | b | c | - +--------+-----+--------+ - | 诶诶诶 | bbb | 西西西 | - +--------+-----+--------+ - ''') - - -def test_user_dtype(): - table = Texttable() - - table.set_cols_align(["l", "r", "r"]) - table.set_cols_dtype([ - 'a', # automatic - lambda s:str(s)+"s", # user-def - lambda s:('%s'%s) if s>=0 else '[%s]'%(-s), # user-def - ]) - table.add_rows([ - ["str", "code-point\nlength", "display\nwidth"], - ["a", 2, 1], - ["a", 1,-3], - ]) - assert clean(table.draw()) == u_dedent('''\ - +-----+------------+---------+ - | str | code-point | display | - | | length | width | - +=====+============+=========+ - | a | 2s | 1 | - +-----+------------+---------+ - | a | 1s | [3] | - +-----+------------+---------+ - ''') - -def test_cjkwarp(): - try: - import cjkwrap - table = Texttable() - - table.set_cols_align(["r", "l"]) - table.add_rows([ - ["Name", 'Discuz! 6.x/7.x 全局变量防御绕过导致命令执行'], - ["Description", '由于php5.3.x版本里php.ini的设置里request_order默认值为GP,导致Discuz! 6.x/7.x 全局变量防御绕过漏洞'], - ], header = False) - assert clean(table.draw()) == u_dedent('''\ - +-------------+----------------------------------------------------------------+ - | Name | Discuz! 6.x/7.x 全局变量防御绕过导致命令执行 | - +-------------+----------------------------------------------------------------+ - | Description | 由于php5.3.x版本里php.ini的设置里request_order默认值为GP,导致 | - | | Discuz! 6.x/7.x 全局变量防御绕过漏洞 | - +-------------+----------------------------------------------------------------+ - ''') - 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 --git a/texttable-1.6.0.tar.gz b/texttable-1.6.0.tar.gz deleted file mode 100644 index afaf3c5..0000000 --- a/texttable-1.6.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:624b9d6a94255b3d168b22f0808b78eca8b765d8b14c095e530641b8655c7dfc -size 9106 diff --git a/texttable-1.6.1.tar.gz b/texttable-1.6.1.tar.gz new file mode 100644 index 0000000..25cf72b --- /dev/null +++ b/texttable-1.6.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b60a5304ccfbeac80ffae7350d7c2f5d7a24e9aab5036d0f82489746419d9b2 +size 14000