Sunpoet Po-Chuan Hsieh 2019-08-24 00:10:57 +00:00
parent 70587a3329
commit 2e55e45639
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=509705
4 changed files with 6 additions and 82 deletions

View file

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= docutils
PORTVERSION= 0.15
PORTREVISION= 1
PORTVERSION= 0.15.2
CATEGORIES= textproc python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -14,13 +13,13 @@ COMMENT= Python Documentation Utilities
LICENSE= BSD2CLAUSE GPLv3+ PD PSFL
LICENSE_COMB= multi
PORTSCOUT= limit:^[0-9\.]*$$
USES= python
USE_PYTHON= autoplist concurrent distutils
NO_ARCH= yes
PORTSCOUT= limit:^[0-9\.]*$$
OPTIONS_DEFINE= PYGMENTS
PYGMENTS_DESC= Syntax highlighting
PYGMENTS_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pygments>=1.6:textproc/py-pygments@${PY_FLAVOR}

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1564837342
SHA256 (docutils-0.15.tar.gz) = 54a349c622ff31c91cbec43b0b512f113b5b24daf00e2ea530bb1bd9aac14849
SIZE (docutils-0.15.tar.gz) = 1912986
TIMESTAMP = 1566487088
SHA256 (docutils-0.15.2.tar.gz) = a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99
SIZE (docutils-0.15.2.tar.gz) = 1797388

View file

@ -1,43 +0,0 @@
Obtained from: https://sourceforge.net/p/docutils/code/8294/
--- docutils/nodes.py.orig 2019-04-07 08:08:41 UTC
+++ docutils/nodes.py
@@ -29,8 +29,6 @@ import warnings
import types
import unicodedata
-import docutils.utils
-
# ==============================
# Functional Node Base Classes
# ==============================
@@ -322,6 +320,20 @@ def ensure_str(s):
return s.encode('ascii', 'backslashreplace')
return s
+# definition moved here from `utils` to avoid circular import dependency
+def unescape(text, restore_backslashes=False, respect_whitespace=False):
+ """
+ Return a string with nulls removed or restored to backslashes.
+ Backslash-escaped spaces are also removed.
+ """
+ # `respect_whitespace` is ignored (since introduction 2016-12-16)
+ if restore_backslashes:
+ return text.replace('\x00', '\\')
+ else:
+ for sep in ['\x00 ', '\x00\n', '\x00']:
+ text = ''.join(text.split(sep))
+ return text
+
class Text(Node, reprunicode):
@@ -364,7 +376,7 @@ class Text(Node, reprunicode):
return domroot.createTextNode(unicode(self))
def astext(self):
- return reprunicode(docutils.utils.unescape(self))
+ return reprunicode(unescape(self))
# Note about __unicode__: The implementation of __unicode__ here,
# and the one raising NotImplemented in the superclass Node had

View file

@ -1,32 +0,0 @@
Obtained from: https://sourceforge.net/p/docutils/code/8294/
--- docutils/utils/__init__.py.orig 2019-04-07 08:08:42 UTC
+++ docutils/utils/__init__.py
@@ -18,6 +18,7 @@ import warnings
import unicodedata
from docutils import ApplicationError, DataError, __version_info__
from docutils import nodes
+from docutils.nodes import unescape
import docutils.io
from docutils.utils.error_reporting import ErrorOutput, SafeString
@@ -576,18 +577,7 @@ def escape2null(text):
parts.append('\x00' + text[found+1:found+2])
start = found + 2 # skip character after escape
-def unescape(text, restore_backslashes=False, respect_whitespace=False):
- """
- Return a string with nulls removed or restored to backslashes.
- Backslash-escaped spaces are also removed.
- """
- # `respect_whitespace` is ignored (since introduction 2016-12-16)
- if restore_backslashes:
- return text.replace('\x00', '\\')
- else:
- for sep in ['\x00 ', '\x00\n', '\x00']:
- text = ''.join(text.split(sep))
- return text
+# `unescape` definition moved to `nodes` to avoid circular import dependency.
def split_escaped_whitespace(text):
"""