Skip to content

Commit 23a9b5c

Browse files
committed
issue2551285 - Remove StructuredText support
Asked on the users mailing list if anybody was using it. Got no responses. I have never seen CI installing structuredtext packages so it's untested as well.
1 parent e264dc8 commit 23a9b5c

File tree

4 files changed

+5
-48
lines changed

4 files changed

+5
-48
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ Fixed:
131131
- issue2551302 - Remove support for sqlite version 1 from
132132
back_sqlite.py. We have been using sqlite3 for over a decade. (John
133133
Rouillard)
134+
- issue2551285 - Remove StructuredText support. reStructuredText is
135+
still supported. (John Rouillard)
134136

135137
Features:
136138

doc/upgrading.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,9 @@ Deprecation Notices (info)
491491

492492
Support for SQLite version 1 has been removed in 2.4.0.
493493

494+
Support for StructuredText has been removed in 2.4.0. Support for
495+
reStructuredText remains.
496+
494497
Support for the `PySQLite <https://github.com/ghaering/pysqlite>`_
495498
library will be removed in 2.5.0. Only the Python supplied sqlite3
496499
library will be supported.

roundup/cgi/templating.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@
3737

3838
from .KeywordsExpr import render_keywords_expression_editor
3939

40-
try:
41-
from StructuredText.StructuredText import HTML as StructuredText
42-
except ImportError:
43-
try: # older version
44-
import StructuredText
45-
except ImportError:
46-
StructuredText = None
4740
try:
4841
from docutils.core import publish_parts as ReStructuredText
4942
except ImportError:
@@ -1866,19 +1859,6 @@ def wrapped(self, escape=1, hyperlink=1, columns=80):
18661859
s = self.hyper_re.sub(self._hyper_repl, s)
18671860
return s
18681861

1869-
def stext(self, escape=0, hyperlink=1):
1870-
""" Render the value of the property as StructuredText.
1871-
1872-
This requires the StructureText module to be installed separately.
1873-
"""
1874-
if not self.is_view_ok():
1875-
return self._('[hidden]')
1876-
1877-
s = self.plain(escape=escape, hyperlink=hyperlink)
1878-
if not StructuredText:
1879-
return s
1880-
return StructuredText(s, level=1, header=0)
1881-
18821862
def rst(self, hyperlink=1):
18831863
""" Render the value of the property as ReStructuredText.
18841864

test/test_templating.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@
2323
skip_rst = mark_class(pytest.mark.skip(
2424
reason='ReStructuredText not available'))
2525

26-
if StructuredText:
27-
skip_stext = lambda func, *args, **kwargs: func
28-
else:
29-
skip_stext = mark_class(pytest.mark.skip(
30-
reason='StructuredText not available'))
31-
3226
import roundup.cgi.templating
3327
if roundup.cgi.templating._import_mistune():
3428
skip_mistune = lambda func, *args, **kwargs: func
@@ -570,11 +564,6 @@ def test_string_rst(self):
570564
self.assertEqual(t.rst(), u2s(t_result))
571565
self.assertEqual(u.rst(), u2s(u_result))
572566

573-
@skip_stext
574-
def test_string_stext(self):
575-
p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'A string with [email protected] *embedded* \u00df'))
576-
self.assertEqual(p.stext(), u2s(u'<p>A string with <a href="mailto:[email protected]">[email protected]</a> <em>embedded</em> \u00df</p>\n'))
577-
578567
def test_string_field(self):
579568
p = StringHTMLProperty(self.client, 'test', '1', None, 'test', 'A string <b> with [email protected] embedded &lt; html</b>')
580569
self.assertEqual(p.field(), '<input name="test1@test" size="30" type="text" value="A string &lt;b&gt; with [email protected] embedded &amp;lt; html&lt;/b&gt;">')
@@ -1103,23 +1092,6 @@ def test_string_rst(self):
11031092
p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'A string with [email protected] *embedded* \u00df'))
11041093
self.assertEqual(p.rst(), u2s(u'A string with <a href="mailto:[email protected]">[email protected]</a> *embedded* \u00df'))
11051094

1106-
class NoStextTestCase(TemplatingTestCase) :
1107-
def setUp(self):
1108-
TemplatingTestCase.setUp(self)
1109-
1110-
from roundup.cgi import templating
1111-
self.__StructuredText = templating.StructuredText
1112-
templating.StructuredText = None
1113-
1114-
def tearDown(self):
1115-
from roundup.cgi import templating
1116-
templating.StructuredText = self.__StructuredText
1117-
1118-
def test_string_stext(self):
1119-
p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'A string with [email protected] *embedded* \u00df'))
1120-
self.assertEqual(p.stext(), u2s(u'A string with <a href="mailto:[email protected]">[email protected]</a> *embedded* \u00df'))
1121-
1122-
11231095
class ZUtilsTestcase(TemplatingTestCase):
11241096

11251097
def test_Iterator(self):

0 commit comments

Comments
 (0)