Hello community,
here is the log from the commit of package python-textile for
openSUSE:Leap:15.2 checked in at 2020-03-02 13:23:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-textile (Old)
and /work/SRC/openSUSE:Leap:15.2/.python-textile.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-textile"
Mon Mar 2 13:23:56 2020 rev:17 rq:777215 version:4.0.1
Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-textile/python-textile.changes
2020-01-15 15:53:48.831610645 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.python-textile.new.26092/python-textile.changes
2020-03-02 13:23:57.130469321 +0100
@@ -1,0 +2,24 @@
+Sat Feb 1 15:14:57 UTC 2020 - Sebastian Wagner <[email protected]>
+
+- update to version 4.0.1:
+ - Bugfixes:
+ - SyntaxWarnings with Python 3.8
i("#71":https://github.com/textile/python-textile/issues/71)
+ - testsuite: internal error with coverage 5.0.X
("#72":https://github.com/textile/python-textile/issues/72)
+ - DeprecationWarnings about invalid escape sequences
("#73":https://github.com/textile/python-textile/issues/73)
+
+-------------------------------------------------------------------
+Sat Jan 18 10:49:22 UTC 2020 - Sebastian Wagner <[email protected]>
+
+- drop python 2, not supported anymore upstream
+- update to version 4.0.0:
+ - Drop support for Python 2, hence the version bump. Update list of PY3K
versions to currently-supported versions. If you need to use textile on Python
2.7 or Python 3.3 or 3.4, please use textile Version 3.0.4.
+ - For use in PyPy environments, textile used to work well with the regex
package. Lately, it's running into trouble. Please uninstall regex if this is
the case for you.
+
+-------------------------------------------------------------------
+Sun Jun 9 06:45:28 UTC 2019 - Sebastian Wagner <[email protected]>
+
+- update to version 3.0.4:
+ - BUGFIX: Restricted mode strips out CSS attributes again.
+ - Update travis to more current versions and test against current Pillow
version.
+
+-------------------------------------------------------------------
Old:
----
textile-3.0.3.tar.gz
New:
----
textile-4.0.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-textile.spec ++++++
--- /var/tmp/diff_new_pack.qYpIbs/_old 2020-03-02 13:23:58.002471055 +0100
+++ /var/tmp/diff_new_pack.qYpIbs/_new 2020-03-02 13:23:58.006471063 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-textile
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,32 +12,31 @@
# 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-%{**}}
%bcond_without test
+%define skip_python2 1
Name: python-textile
-Version: 3.0.3
+Version: 4.0.1
Release: 0
Summary: Textile processing for python
License: BSD-3-Clause
Group: Development/Languages/Python
-Url: http://github.com/textile/python-textile
+URL: http://github.com/textile/python-textile
Source:
https://files.pythonhosted.org/packages/source/t/textile/textile-%{version}.tar.gz
-Requires: python-Pillow >= 3.0.0
-Requires: python-html5lib >= 0.999999999
+Requires: python-Pillow
+Requires: python-html5lib >= 1.0.1
Requires: python-six
Recommends: python-regex
-BuildRequires: %{python_module devel}
-BuildRequires: %{python_module pytest-cov}
-BuildRequires: %{python_module pytest-runner}
BuildRequires: %{python_module setuptools}
%if %{with test}
-# not needed as the test requires internet connection
-#BuildRequires: %%{python_module Pillow >= 3.0.0}
-BuildRequires: %{python_module html5lib >= 0.999999999}
+BuildRequires: %{python_module html5lib >= 1.0.1}
+BuildRequires: %{python_module pytest-cov}
+BuildRequires: %{python_module pytest-runner}
+BuildRequires: %{python_module regex >= 1.0}
%endif
BuildRequires: fdupes
BuildRequires: python-rpm-macros
++++++ textile-3.0.3.tar.gz -> textile-4.0.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/.coveragerc
new/textile-4.0.1/.coveragerc
--- old/textile-3.0.3/.coveragerc 2018-04-10 16:20:24.000000000 +0200
+++ new/textile-4.0.1/.coveragerc 2020-01-25 16:43:07.000000000 +0100
@@ -1,5 +1,7 @@
[run]
branch = True
+source = textile
+parallel = True
[report]
show_missing = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/CHANGELOG.textile
new/textile-4.0.1/CHANGELOG.textile
--- old/textile-3.0.3/CHANGELOG.textile 2018-04-22 16:17:44.000000000 +0200
+++ new/textile-4.0.1/CHANGELOG.textile 2020-01-25 16:48:46.000000000 +0100
@@ -1,5 +1,19 @@
h1. Textile Changelog
+h2. Version 4.0.1
+* Bugfixes:
+** SyntaxWarnings with Python 3.8
i("#71":https://github.com/textile/python-textile/issues/71)
+** testsuite: internal error with coverage 5.0.X
("#72":https://github.com/textile/python-textile/issues/72)
+** DeprecationWarnings about invalid escape sequences
("#73":https://github.com/textile/python-textile/issues/73)
+
+h2. Version 4.0.0
+* Drop support for Python 2, hence the version bump. Update list of PY3K
versions to currently-supported versions. If you need to use textile on Python
2.7 or Python 3.3 or 3.4, please use textile Version 3.0.4.
+* For use in PyPy environments, textile used to work well with the regex
package. Lately, it's running into trouble. Please uninstall regex if this is
the case for you.
+
+h2. Version 3.0.4
+* BUGFIX: Restricted mode strips out CSS attributes again.
+* Update travis to more current versions and test against current Pillow
version.
+
h2. Version 3.0.3
* BUGFIX: Improve handling code block following extended p block
("#63":https://github.com/textile/python-textile/pull/63)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/CONTRIBUTORS.txt
new/textile-4.0.1/CONTRIBUTORS.txt
--- old/textile-3.0.3/CONTRIBUTORS.txt 2018-04-10 16:20:24.000000000 +0200
+++ new/textile-4.0.1/CONTRIBUTORS.txt 2020-01-12 21:47:21.000000000 +0100
@@ -5,4 +5,6 @@
Mark Pilgrim
Alex Shiels
Jason Samsa
-Kurt Raschke
\ No newline at end of file
+Kurt Raschke
+Dave Brondsema
+Dmitry Shachnev
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/PKG-INFO new/textile-4.0.1/PKG-INFO
--- old/textile-3.0.3/PKG-INFO 2018-04-22 16:20:36.000000000 +0200
+++ new/textile-4.0.1/PKG-INFO 2020-01-25 17:04:15.136586400 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: textile
-Version: 3.0.3
+Version: 4.0.1
Summary: Textile processing for python.
Home-page: http://github.com/textile/python-textile
Author: Dennis Burke
@@ -15,17 +15,13 @@
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
-Provides-Extra: regex
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Requires-Python: ~=3.5
Provides-Extra: develop
Provides-Extra: imagesize
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/README.textile
new/textile-4.0.1/README.textile
--- old/textile-3.0.3/README.textile 2018-04-10 16:20:24.000000000 +0200
+++ new/textile-4.0.1/README.textile 2020-01-12 21:46:19.000000000 +0100
@@ -1,4 +1,4 @@
-!https://travis-ci.org/textile/python-textile.svg!:https://travis-ci.org/textile/python-textile
!https://coveralls.io/repos/github/textile/python-textile/badge.svg!:https://coveralls.io/github/textile/python-textile?branch=master
!https://codecov.io/github/textile/python-textile/coverage.svg!:https://codecov.io/github/textile/python-textile
+!https://travis-ci.org/textile/python-textile.svg!:https://travis-ci.org/textile/python-textile
!https://coveralls.io/repos/github/textile/python-textile/badge.svg!:https://coveralls.io/github/textile/python-textile?branch=master
!https://codecov.io/github/textile/python-textile/coverage.svg!:https://codecov.io/github/textile/python-textile
!https://img.shields.io/pypi/pyversions/textile!
!https://img.shields.io/pypi/wheel/textile!
h1. python-textile
@@ -8,9 +8,12 @@
@pip install textile@
+Dependencies:
+* "html5lib":https://pypi.org/project/html5lib/
+* "regex":https://pypi.org/project/regex/ (The regex package causes problems
with PyPy, and is not installed as a dependency in such environments. If you
are upgrading a textile install on PyPy which had regex previously included,
you may need to uninstall it.)
+
Optional dependencies include:
-* "PIL/Pillow":http://python-pillow.github.io/ (for checking images size)
-* "regex":https://pypi.python.org/pypi/regex (for faster unicode-aware string
matching).
+* "PIL/Pillow":http://python-pillow.github.io/ (for checking image sizes). If
needed, install via @pip install 'textile[imagesize]'@
h2. Usage
@@ -39,4 +42,4 @@
h3. Notes:
-* Active development supports Python 2.7 or later (including Python 3.3+).
+* Active development supports Python 3.5 or later.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/requirements.txt
new/textile-4.0.1/requirements.txt
--- old/textile-3.0.3/requirements.txt 2018-04-10 16:20:24.000000000 +0200
+++ new/textile-4.0.1/requirements.txt 1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-html5lib>=1.0b10
-Pillow==3.0.0
-regex
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/setup.cfg new/textile-4.0.1/setup.cfg
--- old/textile-3.0.3/setup.cfg 2018-04-22 16:20:36.000000000 +0200
+++ new/textile-4.0.1/setup.cfg 2020-01-25 17:04:15.136586400 +0100
@@ -1,9 +1,6 @@
[aliases]
test = pytest
-[bdist_wheel]
-universal = 1
-
[egg_info]
tag_build =
tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/setup.py new/textile-4.0.1/setup.py
--- old/textile-3.0.3/setup.py 2018-04-10 16:20:24.000000000 +0200
+++ new/textile-4.0.1/setup.py 2020-01-12 21:47:21.000000000 +0100
@@ -42,28 +42,22 @@
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
- 'Topic :: Software Development :: Libraries :: Python Modules',
- 'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.6',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.2',
- 'Programming Language :: Python :: 3.3',
- 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='textile,text,html markup',
install_requires=[
- 'six',
- 'html5lib>=0.999999999',
+ 'html5lib>=1.0.1',
+ 'regex>1.0; implementation_name != "pypy"',
],
extras_require={
- ':python_version=="2.6"': ['ordereddict>=1.1'],
'develop': ['pytest', 'pytest-cov'],
'imagesize': ['Pillow>=3.0.0'],
- 'regex': ['regex'],
},
entry_points={'console_scripts': ['pytextile=textile.__main__:main']},
setup_requires=['pytest-runner'],
@@ -71,4 +65,5 @@
cmdclass = {'test': PyTest},
include_package_data=True,
zip_safe=False,
+ python_requires='~=3.5',
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/tests/fixtures/README.txt
new/textile-4.0.1/tests/fixtures/README.txt
--- old/textile-3.0.3/tests/fixtures/README.txt 2018-04-10 16:20:24.000000000
+0200
+++ new/textile-4.0.1/tests/fixtures/README.txt 2020-01-12 21:46:19.000000000
+0100
@@ -1,4 +1,4 @@
- <p><a href="https://travis-ci.org/textile/python-textile"><img alt=""
src="https://travis-ci.org/textile/python-textile.svg" /></a> <a
href="https://coveralls.io/github/textile/python-textile?branch=master"><img
alt="" src="https://coveralls.io/repos/github/textile/python-textile/badge.svg"
/></a> <a href="https://codecov.io/github/textile/python-textile"><img alt=""
src="https://codecov.io/github/textile/python-textile/coverage.svg" /></a></p>
+ <p><a href="https://travis-ci.org/textile/python-textile"><img alt=""
src="https://travis-ci.org/textile/python-textile.svg" /></a> <a
href="https://coveralls.io/github/textile/python-textile?branch=master"><img
alt="" src="https://coveralls.io/repos/github/textile/python-textile/badge.svg"
/></a> <a href="https://codecov.io/github/textile/python-textile"><img alt=""
src="https://codecov.io/github/textile/python-textile/coverage.svg" /></a> <img
alt="" src="https://img.shields.io/pypi/pyversions/textile" /> <img alt=""
src="https://img.shields.io/pypi/wheel/textile" /></p>
<h1>python-textile</h1>
@@ -8,10 +8,15 @@
<p><code>pip install textile</code></p>
+ <p>Dependencies:
+ <ul>
+ <li><a
href="https://pypi.org/project/html5lib/">html5lib</a></li>
+ <li><a href="https://pypi.org/project/regex/">regex</a> (The
regex package causes problems with PyPy, and is not installed as a dependency
in such environments. If you are upgrading a textile install on PyPy which had
regex previously included, you may need to uninstall it.)</li>
+ </ul></p>
+
<p>Optional dependencies include:
<ul>
- <li><a href="http://python-pillow.github.io/"><span
class="caps">PIL</span>/Pillow</a> (for checking images size)</li>
- <li><a href="https://pypi.python.org/pypi/regex">regex</a> (for
faster unicode-aware string matching).</li>
+ <li><a href="http://python-pillow.github.io/"><span
class="caps">PIL</span>/Pillow</a> (for checking image sizes). If needed,
install via <code>pip install 'textile[imagesize]'</code></li>
</ul></p>
<h2>Usage</h2>
@@ -42,5 +47,5 @@
<h3>Notes:</h3>
<ul>
- <li>Active development supports Python 2.7 or later (including
Python 3.3+).</li>
+ <li>Active development supports Python 3.5 or later.</li>
</ul>
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/tests/test_cli.py
new/textile-4.0.1/tests/test_cli.py
--- old/textile-3.0.3/tests/test_cli.py 2018-04-10 16:20:24.000000000 +0200
+++ new/textile-4.0.1/tests/test_cli.py 2020-01-12 21:46:19.000000000 +0100
@@ -1,4 +1,3 @@
-import six
import subprocess
import sys
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/tests/test_textile.py
new/textile-4.0.1/tests/test_textile.py
--- old/textile-3.0.3/tests/test_textile.py 2018-04-10 16:20:24.000000000
+0200
+++ new/textile-4.0.1/tests/test_textile.py 2019-06-08 18:32:59.000000000
+0200
@@ -53,6 +53,46 @@
assert result == expect
+ test = "p{color:blue}. is this blue?"
+ result = textile.textile_restricted(test)
+ expect = '\t<p>is this blue?</p>'
+
+ assert result == expect
+
+ test = """\
+table{border:1px solid black}.
+|={color:gray}. Your caption goes here
+|~.
+|{position:absolute}. A footer | foo |
+|-.
+|_{font-size:xxlarge}. header|_=. centered header|
+|~. bottom aligned|{background:red;width:200px}. asfd|"""
+ result = textile.textile_restricted(test, lite=False)
+ # styles from alignment hints like =. and ~. are ok
+ expect = '''\
+\t<table>
+\t<caption>Your caption goes here</caption>
+\t
+\t<tfoot>
+\t\t<tr>
+\t\t\t<td>A footer </td>
+\t\t\t<td> foo </td>
+\t\t</tr>
+\t</tfoot>
+\t<tbody>
+\t\t<tr>
+\t\t\t<th>header</th>
+\t\t\t<th style="text-align:center;">centered header</th>
+\t\t</tr>
+\t\t<tr>
+\t\t\t<td style="vertical-align:bottom;">bottom aligned</td>
+\t\t\t<td>asfd</td>
+\t\t</tr>
+\t</tbody>
+\t</table>'''
+
+ assert result == expect
+
def test_unicode_footnote():
html = textile.textile('текст[1]')
assert re.compile(r'^\t<p>текст<sup class="footnote"
id="fnrev([a-f0-9]{32})-1"><a href="#fn\1-1">1</a></sup></p>$',
re.U).search(html) is not None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/textile/core.py
new/textile-4.0.1/textile/core.py
--- old/textile-3.0.3/textile/core.py 2018-04-22 16:16:38.000000000 +0200
+++ new/textile-4.0.1/textile/core.py 2020-01-25 16:43:07.000000000 +0100
@@ -17,11 +17,9 @@
Additions and fixes Copyright (c) 2006 Alex Shiels http://thresholdstate.com/
"""
-
import uuid
-import six
-from six.moves.urllib_parse import (urlparse, urlsplit, urlunsplit, quote,
- unquote)
+from urllib.parse import urlparse, urlsplit, urlunsplit, quote, unquote
+from collections import OrderedDict
from textile.tools import sanitizer, imagesize
from textile.regex_strings import (align_re_s, cls_re_s, pnct_re_s,
@@ -31,10 +29,6 @@
parse_attributes, pba)
from textile.objects import Block, Table
-
-from collections import OrderedDict
-
-
try:
import regex as re
except ImportError:
@@ -46,7 +40,7 @@
unrestricted_url_schemes = restricted_url_schemes + ('file', 'tel',
'callto', 'sftp', 'data')
- btag = ('bq', 'bc', 'notextile', 'pre', 'h[1-6]', 'fn\d+', 'p', '###')
+ btag = ('bq', 'bc', 'notextile', 'pre', 'h[1-6]', r'fn\d+', 'p', '###')
btag_lite = ('bq', 'bc', 'p')
note_index = 1
@@ -170,7 +164,6 @@
regex_snippets['space'], 'abr': regex_snippets['abr'],
'nab': regex_snippets['nab'], 'pnct': pnct_re_s}), re.U),
]
-
# These are the changes that need to be made for characters that occur
# at the beginning of the string.
self.glyph_search_initial = list(self.glyph_search)
@@ -259,7 +252,6 @@
if not self.lite:
text = self.placeNoteLists(text)
-
text = self.retrieve(text)
text = text.replace('{0}:glyph:'.format(self.uid), '')
@@ -327,7 +319,7 @@
# does the first line of this ol have a start attribute
if len(tl) > len(pt):
- # no, set it to 1
+ # no, set it to 1.
if start is None:
self.olstarts[tl] = 1
# yes, set it to the given number
@@ -352,8 +344,8 @@
except KeyError:
self.olstarts[tl] = 1
- nm = re.match("^(?P<nextlistitem>[#\*;:]+)(_|[\d]+)?{0}"
- "[ .].*".format(cls_re_s), nextline)
+ nm = re.match(r"^(?P<nextlistitem>[#\*;:]+)(_|[\d]+)?{0}"
+ r"[ .].*".format(cls_re_s), nextline)
if nm:
nl = nm.group('nextlistitem')
@@ -363,12 +355,11 @@
if ';' in pt and ':' in tl:
ls[tl] = 2
- atts = pba(atts)
+ atts = pba(atts, restricted=self.restricted)
tabs = '\t' * len(tl)
- # If start is still None, set it to '', else leave the value
- # that we've already formatted.
+ # If start is still None, set it to '', else leave the value that
+ # we've already formatted.
start = start or ''
-
# if this item tag isn't in the list, create a new list and
# item, else just create the item
if tl not in ls:
@@ -380,7 +371,6 @@
line = ("\t<{0}{1}>{2}".format(litem, atts, content) if
showitem else '')
line = '{0}{1}'.format(tabs, line)
-
if len(nl) <= len(tl):
if showitem:
line = "{0}</{1}>".format(line, litem)
@@ -393,14 +383,12 @@
if len(k) > 1 and v != 2:
line = "{0}</{1}>".format(line, litem)
del ls[k]
-
- # Remember the current Textile tag
+ # Remember the current Textile tag:
pt = tl
-
# This else exists in the original php version. I'm not sure how
# to come up with a case where the line would not match. I think
# it may have been necessary due to the way php returns matches.
- #else:
+ # else:
#line = "{0}\n".format(line)
result.append(line)
return self.doTagBr(litem, "\n".join(result))
@@ -424,13 +412,12 @@
tre = '|'.join(self.btag)
else:
tre = '|'.join(self.btag_lite)
-
# split the text by two or more newlines, retaining the newlines in the
# split list
text = re.split(r'(\n{2,})', text)
# some blocks, when processed, will ask us to output nothing, if that's
- # the case, we'd want to drop the whitespace which comes after it.
+ # the case, we'd want to drop the whitespace which follows it.
eat_whitespace = False
# check to see if previous block has already been escaped
@@ -498,7 +485,7 @@
# no tag specified
else:
# if we're inside an extended block, add the text from the
- # previous line to the front
+ # previous line to the front.
if ext and out:
if block.tag == 'p':
line = generate_tag(block.tag, line, block.outer_atts)
@@ -535,7 +522,6 @@
multiline_para = True
else:
line = self.doPBr(line)
-
if not block.tag == 'p':
multiline_para = False
@@ -561,8 +547,8 @@
if block.eat:
eat_whitespace = True
- # at this point, we've gone through all the lines, and if there's still
- # an extension in effect, we close it here.
+ # at this point, we've gone through all the lines. if there's still an
+ # extension in effect, we close it here
if ext and out and not block.tag == 'p':
block.content = out.pop()
block.process()
@@ -727,7 +713,7 @@
linkparts = []
i = 0
- while balanced is not 0 or i is 0: # pragma: no branch
+ while balanced != 0 or i == 0: # pragma: no branch
# Starting at the end, pop off the previous part of the
# slice's fragments.
@@ -750,7 +736,7 @@
# HAL!"":url... In this case we count a zero length in
# the last position as a closing quote and others as
# opening quotes.
- if i is 0:
+ if i == 0:
balanced = balanced + 1
else:
balanced = balanced - 1
@@ -765,7 +751,7 @@
break
# If the next possibility is empty or ends in a space
# we have a closing ".
- if (possibility is '' or possibility.endswith(' ')):
+ if (possibility == '' or possibility.endswith(' ')):
# force search exit
balanced = 0;
@@ -843,7 +829,7 @@
# "text":url?q[]=x][123] will have "[123]" popped off the back, the
# remaining closing square brackets will later be tested for balance
if (counts[']']):
- m = re.search('(?P<url>^.*\])(?P<tight>\[.*?)$', url, flags=re.U)
+ m = re.search(r'(?P<url>^.*\])(?P<tight>\[.*?)$', url, flags=re.U)
if m:
url, tight = m.groups()
@@ -961,13 +947,13 @@
text = self.span(text)
text = self.glyphs(text)
url = self.shelveURL(self.encode_url(urlunsplit(uri_parts)))
- attributes = parse_attributes(atts)
+ attributes = parse_attributes(atts, restricted=self.restricted)
+ attributes['href'] = url
if title:
# if the title contains unicode data, it is annoying to get Python
# 2.6 and all the latter versions working properly. But shelving
# the title is a quick and dirty solution.
attributes['title'] = self.shelve(title)
- attributes['href'] = url
if self.rel:
attributes['rel'] = self.rel
a_text = generate_tag('a', text, attributes)
@@ -985,10 +971,6 @@
Fixed version of the following code fragment from Stack Overflow:
http://stackoverflow.com/a/804380/72656
"""
- # turn string into unicode
- if not isinstance(url, six.text_type):
- url = url.decode('utf8')
-
# parse it
parsed = urlsplit(url)
@@ -1017,12 +999,8 @@
# slashes, and this is a way to clean that up. It branches for PY2/3
# because the quote and unquote functions expects different input
# types: unicode strings for PY2 and str for PY3.
- if six.PY2:
- path_parts = (quote(unquote(pce.encode('utf8')), b'') for pce in
- parsed.path.split('/'))
- else:
- path_parts = (quote(unquote(pce), b'') for pce in
- parsed.path.split('/'))
+ path_parts = (quote(unquote(pce), b'') for pce in
+ parsed.path.split('/'))
path = '/'.join(path_parts)
# put it back together
@@ -1078,7 +1056,7 @@
}
tag = qtags[tag]
- atts = pba(atts)
+ atts = pba(atts, restricted=self.restricted)
if cite:
atts = '{0} cite="{1}"'.format(atts, cite.rstrip())
@@ -1128,14 +1106,14 @@
atts.update(align=alignments[align])
atts.update(alt=title)
if size:
- atts.update(height=six.text_type(size[1]))
+ atts.update(height="{0}".format(size[1]))
atts.update(src=url)
if attributes:
- atts.update(parse_attributes(attributes))
+ atts.update(parse_attributes(attributes,
restricted=self.restricted))
if title:
atts.update(title=title)
if size:
- atts.update(width=six.text_type(size[0]))
+ atts.update(width="{0}".format(size[0]))
img = generate_tag('img', ' /', atts)
if href:
a_atts = OrderedDict(href=href)
@@ -1220,7 +1198,7 @@
atts, content = m.groups()
# cleanup
content = content.strip()
- atts = pba(atts)
+ atts = pba(atts, restricted=self.restricted)
# split the content into the term and definition
xm = re.match(r'^(.*?)[\s]*:=(.*?)[\s]*(=:|:=)?[\s]*$', content,
@@ -1269,8 +1247,8 @@
# sort o by key
o = OrderedDict(sorted(o.items(), key=lambda t: t[0]))
self.notes = o
- text_re = re.compile('<p>notelist({0})(?:\:([\w|{1}]))?([\^!]?)(\+?)'
- '\.?[\s]*</p>'.format(cls_re_s, syms_re_s), re.U)
+ text_re = re.compile(r'<p>notelist({0})(?:\:([\w|{1}]))?([\^!]?)(\+?)'
+ r'\.?[\s]*</p>'.format(cls_re_s, syms_re_s), re.U)
text = text_re.sub(self.fNoteLists, text)
return text
@@ -1306,7 +1284,7 @@
o.append(li)
self.notelist_cache[index] = "\n".join(o)
result = self.notelist_cache[index]
- list_atts = pba(att)
+ list_atts = pba(att, restricted=self.restricted)
result = '<ol{0}>\n{1}\n\t</ol>'.format(list_atts, result)
return result
@@ -1351,7 +1329,7 @@
# Ignores subsequent defs using the same label
if 'def' not in self.notes[label]: # pragma: no branch
- self.notes[label]['def'] = {'atts': pba(att), 'content':
+ self.notes[label]['def'] = {'atts': pba(att,
restricted=self.restricted), 'content':
self.graf(content), 'link': link}
return ''
@@ -1373,7 +1351,7 @@
processed into the notes array. So now we can resolve the link numbers
in the order we process the refs..."""
atts, label, nolink = match.groups()
- atts = pba(atts)
+ atts = pba(atts, restricted=self.restricted)
nolink = nolink == '!'
# Assign a sequence number to this reference if there isn't one already
@@ -1420,7 +1398,7 @@
def retrieveURL(self, match):
url = self.refCache.get(int(match.group('token')), '')
- if url is '':
+ if url == '':
return url
if url in self.urlrefs:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/textile/objects/block.py
new/textile-4.0.1/textile/objects/block.py
--- old/textile-3.0.3/textile/objects/block.py 2018-04-10 16:20:24.000000000
+0200
+++ new/textile-4.0.1/textile/objects/block.py 2020-01-06 02:56:28.000000000
+0100
@@ -20,7 +20,7 @@
self.cite = cite
self.content = content
- self.attributes = parse_attributes(atts)
+ self.attributes = parse_attributes(atts,
restricted=self.textile.restricted)
self.outer_tag = ''
self.inner_tag = ''
self.outer_atts = OrderedDict()
@@ -69,7 +69,7 @@
if 'id' not in self.attributes:
self.attributes.update({'id': 'fn{0}'.format(fnid)})
else:
- supp_id = parse_attributes('(#fn{0})'.format(fnid))
+ supp_id = parse_attributes('(#fn{0})'.format(fnid),
restricted=self.textile.restricted)
if '^' not in self.atts:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/textile/objects/table.py
new/textile-4.0.1/textile/objects/table.py
--- old/textile-3.0.3/textile/objects/table.py 2018-04-10 16:20:24.000000000
+0200
+++ new/textile-4.0.1/textile/objects/table.py 2020-01-12 21:46:19.000000000
+0100
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
-import six
from xml.etree import ElementTree
from textile.regex_strings import (align_re_s, cls_re_s, regex_snippets,
@@ -17,7 +16,7 @@
class Table(object):
def __init__(self, textile, tatts, rows, summary):
self.textile = textile
- self.attributes = parse_attributes(tatts, 'table')
+ self.attributes = parse_attributes(tatts, 'table',
restricted=self.textile.restricted)
if summary:
self.attributes.update(summary=summary.strip())
self.input = rows
@@ -44,7 +43,7 @@
caption_re = re.compile(captionpattern, re.S)
cmtch = caption_re.match(row)
if cmtch:
- caption = Caption(**cmtch.groupdict())
+ caption = Caption(restricted=self.textile.restricted,
**cmtch.groupdict())
self.caption = '\n{0}'.format(caption.caption)
row = cmtch.group('row').lstrip()
if row == '':
@@ -60,7 +59,7 @@
colgroup_atts, cols = colgroup_data, None
if '|' in colgroup_data:
colgroup_atts, cols = colgroup_data.split('|', 1)
- colgrp = Colgroup(cols, colgroup_atts)
+ colgrp = Colgroup(cols, colgroup_atts,
restricted=self.textile.restricted)
self.colgroup = colgrp.process()
if row == '':
continue
@@ -79,13 +78,13 @@
if rgrp:
groups.append('\n\t{0}'.format(rgrp.process()))
rgrp = grptypes[grpmatch.group('part')](grpmatch.group(
- 'rgrpatts'))
+ 'rgrpatts'), restricted=self.textile.restricted)
row = grpmatch.group('row')
rmtch = re.search(r'^(?P<ratts>{0}{1}\. )(?P<row>.*)'.format(
align_re_s, cls_re_s), row.lstrip())
if rmtch:
- row_atts = parse_attributes(rmtch.group('ratts'), 'tr')
+ row_atts = parse_attributes(rmtch.group('ratts'), 'tr',
restricted=self.textile.restricted)
row = rmtch.group('row')
else:
row_atts = {}
@@ -102,7 +101,7 @@
cls_re_s), cell, flags=re.S)
if cmtch:
catts = cmtch.group('catts')
- cell_atts = parse_attributes(catts, 'td')
+ cell_atts = parse_attributes(catts, 'td',
restricted=self.textile.restricted)
cell = cmtch.group('cell')
else:
cell_atts = {}
@@ -139,8 +138,8 @@
class Caption(object):
- def __init__(self, capts, cap, row):
- self.attributes = parse_attributes(capts)
+ def __init__(self, capts, cap, row, restricted):
+ self.attributes = parse_attributes(capts, restricted=restricted)
self.caption = self.process(cap)
def process(self, cap):
@@ -149,17 +148,16 @@
class Colgroup(object):
- def __init__(self, cols, atts):
+ def __init__(self, cols, atts, restricted):
self.row = ''
self.attributes = atts
self.cols = cols
+ self.restricted = restricted
def process(self):
enc = 'unicode'
- if six.PY2: # pragma: no branch
- enc = 'UTF-8'
- group_atts = parse_attributes(self.attributes, 'col')
+ group_atts = parse_attributes(self.attributes, 'col',
restricted=self.restricted)
colgroup = ElementTree.Element('colgroup', attrib=group_atts)
colgroup.text = '\n\t'
if self.cols is not None:
@@ -168,7 +166,7 @@
# colgroup is the first item in match_cols, the remaining items are
# cols.
for idx, col in enumerate(match_cols):
- col_atts = parse_attributes(col.strip(), 'col')
+ col_atts = parse_attributes(col.strip(), 'col',
restricted=self.restricted)
ElementTree.SubElement(colgroup, 'col', col_atts)
colgrp = ElementTree.tostring(colgroup, encoding=enc)
# cleanup the extra xml declaration if it exists, (python versions
@@ -205,9 +203,9 @@
class _TableSection(object):
- def __init__(self, tag, attributes):
+ def __init__(self, tag, attributes, restricted):
self.tag = tag
- self.attributes = parse_attributes(attributes)
+ self.attributes = parse_attributes(attributes, restricted=restricted)
self.rows = []
def process(self):
@@ -215,15 +213,15 @@
class Thead(_TableSection):
- def __init__(self, attributes):
- super(Thead, self).__init__('thead', attributes)
+ def __init__(self, attributes, restricted):
+ super(Thead, self).__init__('thead', attributes, restricted)
class Tbody(_TableSection):
- def __init__(self, attributes):
- super(Tbody, self).__init__('tbody', attributes)
+ def __init__(self, attributes, restricted):
+ super(Tbody, self).__init__('tbody', attributes, restricted)
class Tfoot(_TableSection):
- def __init__(self, attributes):
- super(Tfoot, self).__init__('tfoot', attributes)
+ def __init__(self, attributes, restricted):
+ super(Tfoot, self).__init__('tfoot', attributes, restricted)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/textile/regex_strings.py
new/textile-4.0.1/textile/regex_strings.py
--- old/textile-3.0.3/textile/regex_strings.py 2018-04-10 16:20:24.000000000
+0200
+++ new/textile-4.0.1/textile/regex_strings.py 2020-01-12 21:46:19.000000000
+0100
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
-import six
-
try:
# Use regex module for matching uppercase characters if installed,
# otherwise fall back to finding all the uppercase chars in a loop.
@@ -21,8 +19,8 @@
except ImportError:
from sys import maxunicode
upper_re_s = "".join(
- [six.unichr(c) for c in six.moves.range(maxunicode) if six.unichr(
- c).isupper()])
+ [chr(c) for c in range(maxunicode) if chr(c).isupper()]
+ )
regex_snippets = {
'acr': r'{0}0-9'.format(upper_re_s),
'abr': r'{0}'.format(upper_re_s),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/textile/tools/imagesize.py
new/textile-4.0.1/textile/tools/imagesize.py
--- old/textile-3.0.3/textile/tools/imagesize.py 2018-04-10
16:20:24.000000000 +0200
+++ new/textile-4.0.1/textile/tools/imagesize.py 2020-01-12
21:46:19.000000000 +0100
@@ -11,10 +11,7 @@
except ImportError:
return ''
- try:
- from urllib.request import urlopen
- except (ImportError):
- from urllib2 import urlopen
+ from urllib.request import urlopen
try:
p = ImageFile.Parser()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/textile/utils.py
new/textile-4.0.1/textile/utils.py
--- old/textile-3.0.3/textile/utils.py 2018-04-10 16:20:24.000000000 +0200
+++ new/textile-4.0.1/textile/utils.py 2020-01-12 21:46:19.000000000 +0100
@@ -1,14 +1,12 @@
from __future__ import unicode_literals
-import six
try:
import regex as re
except ImportError:
import re
-from six.moves import urllib, html_parser
-urlparse = urllib.parse.urlparse
-HTMLParser = html_parser.HTMLParser
+from urllib.parse import urlparse
+import html
from collections import OrderedDict
@@ -19,9 +17,8 @@
def decode_high(text):
"""Decode encoded HTML entities."""
- h = HTMLParser()
text = '&#{0};'.format(text)
- return h.unescape(text)
+ return html.unescape(text)
def encode_high(text):
"""Encode the text so that it is an appropriate HTML entity."""
@@ -46,23 +43,23 @@
"""Generate a complete html tag using the ElementTree module. tag and
content are strings, the attributes argument is a dictionary. As
a convenience, if the content is ' /', a self-closing tag is generated."""
- content = six.text_type(content)
- # In PY2, ElementTree tostringlist only works with bytes, not with
- # unicode().
enc = 'unicode'
- if six.PY2:
- enc = 'UTF-8'
if not tag:
return content
element = ElementTree.Element(tag, attrib=attributes)
+ # Sort attributes for Python 3.8+, as suggested in
+ # https://docs.python.org/3/library/xml.etree.elementtree.html
+ if len(element.attrib) > 1:
+ # adjust attribute order, e.g. by sorting
+ attribs = sorted(element.attrib.items())
+ element.attrib.clear()
+ element.attrib.update(attribs)
# FIXME: Kind of an ugly hack. There *must* be a cleaner way. I tried
# adding text by assigning it to element_tag.text. That results in
# non-ascii text being html-entity encoded. Not bad, but not entirely
# matching php-textile either.
element_tag = ElementTree.tostringlist(element, encoding=enc,
method='html')
- if six.PY2:
- element_tag = [v.decode(enc) for v in element_tag]
element_tag.insert(len(element_tag) - 1, content)
element_text = ''.join(element_tag)
return element_text
@@ -105,7 +102,7 @@
out = re.sub(r'"$', '" ', out)
return out
-def parse_attributes(block_attributes, element=None, include_id=True):
+def parse_attributes(block_attributes, element=None, include_id=True,
restricted=False):
vAlign = {'^': 'top', '-': 'middle', '~': 'bottom'}
hAlign = {'<': 'left', '=': 'center', '>': 'right', '<>': 'justify'}
style = []
@@ -136,10 +133,11 @@
if m:
style.append("vertical-align:{0}".format(vAlign[m.group(1)]))
- m = re.search(r'\{([^}]*)\}', matched)
- if m:
- style.extend(m.group(1).rstrip(';').split(';'))
- matched = matched.replace(m.group(0), '')
+ if not restricted:
+ m = re.search(r'\{([^}]*)\}', matched)
+ if m:
+ style.extend(m.group(1).rstrip(';').split(';'))
+ matched = matched.replace(m.group(0), '')
m = re.search(r'\[([^\]]+)\]', matched, re.U)
if m:
@@ -197,9 +195,9 @@
result['width'] = width
return result
-def pba(block_attributes, element=None, include_id=True):
+def pba(block_attributes, element=None, include_id=True, restricted=False):
"""Parse block attributes."""
- attrs = parse_attributes(block_attributes, element, include_id)
+ attrs = parse_attributes(block_attributes, element, include_id, restricted)
if not attrs:
return ''
result = ' '.join(['{0}="{1}"'.format(k, v) for k, v in attrs.items()])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/textile/version.py
new/textile-4.0.1/textile/version.py
--- old/textile-3.0.3/textile/version.py 2018-04-22 16:17:44.000000000
+0200
+++ new/textile-4.0.1/textile/version.py 2020-01-25 16:48:46.000000000
+0100
@@ -1 +1 @@
-VERSION = '3.0.3'
+VERSION = '4.0.1'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/textile.egg-info/PKG-INFO
new/textile-4.0.1/textile.egg-info/PKG-INFO
--- old/textile-3.0.3/textile.egg-info/PKG-INFO 2018-04-22 16:20:36.000000000
+0200
+++ new/textile-4.0.1/textile.egg-info/PKG-INFO 2020-01-25 17:04:15.000000000
+0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: textile
-Version: 3.0.3
+Version: 4.0.1
Summary: Textile processing for python.
Home-page: http://github.com/textile/python-textile
Author: Dennis Burke
@@ -15,17 +15,13 @@
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
-Provides-Extra: regex
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Requires-Python: ~=3.5
Provides-Extra: develop
Provides-Extra: imagesize
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/textile.egg-info/SOURCES.txt
new/textile-4.0.1/textile.egg-info/SOURCES.txt
--- old/textile-3.0.3/textile.egg-info/SOURCES.txt 2018-04-22
16:20:36.000000000 +0200
+++ new/textile-4.0.1/textile.egg-info/SOURCES.txt 2020-01-25
17:04:15.000000000 +0100
@@ -5,7 +5,6 @@
MANIFEST.in
README.textile
pytest.ini
-requirements.txt
setup.cfg
setup.py
tests/test_attributes.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/textile-3.0.3/textile.egg-info/requires.txt
new/textile-4.0.1/textile.egg-info/requires.txt
--- old/textile-3.0.3/textile.egg-info/requires.txt 2018-04-22
16:20:36.000000000 +0200
+++ new/textile-4.0.1/textile.egg-info/requires.txt 2020-01-25
17:04:15.000000000 +0100
@@ -1,8 +1,7 @@
-six
-html5lib>=0.999999999
+html5lib>=1.0.1
-[:python_version=="2.6"]
-ordereddict>=1.1
+[:implementation_name != "pypy"]
+regex>1.0
[develop]
pytest
@@ -10,6 +9,3 @@
[imagesize]
Pillow>=3.0.0
-
-[regex]
-regex