summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2002-11-08 01:38:11 +0000
committergoodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2002-11-08 01:38:11 +0000
commit47e460c659b1e295d43604762eff2e9147d7df6c (patch)
treed2c6a047d8e4c1ac2e779e16ab1aca6d6b542aae
parent5f2af13120e6a2a7e8dffeb228dc74e87f57ea7d (diff)
downloaddocutils-47e460c659b1e295d43604762eff2e9147d7df6c.tar.gz
updated
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk/docutils@917 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
-rw-r--r--HISTORY.txt38
-rw-r--r--docs/dev/todo.txt7
-rw-r--r--docs/peps/pep-0258.txt3
-rw-r--r--docutils/parsers/rst/tableparser.py4
-rw-r--r--docutils/utils.py2
-rwxr-xr-xtest/test_parsers/test_rst/test_directives/test_include.py65
-rwxr-xr-xtest/test_parsers/test_rst/test_substitutions.py7
-rw-r--r--test/test_readers/test_pep/test_rfc2822.py24
-rwxr-xr-xtest/test_statemachine.py18
-rwxr-xr-xtools/pep2html.py2
-rw-r--r--tools/stylesheets/pep.css3
11 files changed, 128 insertions, 45 deletions
diff --git a/HISTORY.txt b/HISTORY.txt
index ebb258a7f..054b0d6a3 100644
--- a/HISTORY.txt
+++ b/HISTORY.txt
@@ -18,17 +18,18 @@ suggestions, criticism, bug reports, code contributions, tasty treats,
and related projects:
Aahz, David Ascher, Fred Bremmer, Ian Bicking, Simon Budig, Brett
- Cannon, Adam Chodorowski, Fred Drake, Dethe Elza, fantasai, Jim
- Fulton, Peter Funk, Jorge Gonzalez, Engelbert Gruber, Simon Hefti,
- Doug Hellmann, Juergen Hermann, Jeremy Hylton, Tony Ibbs, Alan
- Jaffray, Dmitry Jemerov, Richard Jones, Garth Kidd, Daniel
- Larsson, Marc-Andre Lemburg, Julien Letessier, Wolfgang Lipp,
- Edward Loper, Dallas Mahrt, Ken Manheimer, Skip Montanaro, Paul
+ Cannon, Adam Chodorowski, Fred Drake, Dethe Elza, fantasai,
+ Stefane Fermigier, Jim Fulton, Peter Funk, Jorge Gonzalez,
+ Engelbert Gruber, Simon Hefti, Doug Hellmann, Juergen Hermann,
+ Michael Hudson, Jeremy Hylton, Tony Ibbs, Alan Jaffray, Dmitry
+ Jemerov, Richard Jones, Andreas Jung, Garth Kidd, Daniel Larsson,
+ Marc-Andre Lemburg, Julien Letessier, Wolfgang Lipp, Edward Loper,
+ Dallas Mahrt, Ken Manheimer, Vasko Miroslav, Skip Montanaro, Paul
Moore, Michel Pelletier, Sam Penrose, Tim Peters, Pearu Peterson,
Mark Pilgrim, Brett g Porter, Tavis Rudd, Oliver Rutherfurd,
Kenichi Sato, Ueli Schlaepfer, Gunnar Schwant, tav, Bob Tolbert,
- Laurence Tratt, Guido van Rossum, Greg Ward, Barry Warsaw, Edward
- Welbourne, Ka-Ping Yee, Moshe Zadka
+ Laurence Tratt, Guido van Rossum, Martin von Loewis, Greg Ward,
+ Barry Warsaw, Edward Welbourne, Ka-Ping Yee, Moshe Zadka
Thank you!
@@ -78,6 +79,8 @@ Specific:
- Bumped version to 0.2.7 for new ``docutils.core.publish_*``
convenience functions.
- Added ``Component.component_type`` attribute.
+ - Bumped version to 0.2.8 because of the internal parser switch from
+ plain lists to the docutils.statemachine.StringList objects.
* docutils/core.py:
@@ -141,14 +144,14 @@ Specific:
- Converted variations on ``node.parent = self`` to
``self.setup_child(node)``.
- Added ``document.current_source`` & ``.current_line``
- attributes, and ``.note_state_machine_change`` &
- ``.note_source`` observer methods.
+ attributes, and ``.note_source`` observer method.
- Changed "system_message" output to GNU-Tools format.
- Added a "rawsource" attribute to the ``Text`` class, for text
before backslash-escape resolution.
- Support for new transform system.
- Reworked ``pending`` element.
+ -
* docutils/statemachine.py:
@@ -172,6 +175,9 @@ Specific:
- Added ``strip_top`` parameter to
``StateMachineWS.get_first_known_indented``.
- Made ``context`` a parameter to ``StateMachine.run()``.
+ - Added ``ViewList`` & ``StringList`` classes;
+ ``extract_indented()`` becomes ``StringList.get_indented()``.
+ - Added ``StateMachine.insert_input()``.
* docutils/utils.py:
@@ -182,6 +188,12 @@ Specific:
- Fixed a bug in ``relative_path()``.
- Added support for improved diagnostics.
+* docutils/languages/fr.py: Added to project; French mappings by
+ Stefane Fermigier.
+
+* docutils/languages/sk.py: Added to project; Slovak mappings by
+ Miroslav Vasko.
+
* docutils/parser/__init__.py:
- Added ``Parser.finish_parse()`` method.
@@ -218,6 +230,7 @@ Specific:
- Renamed ``Stuff`` to ``Struct``.
- Now flagged as errors: transitions at the beginning or end of
sections, empty sections (except title), and empty documents.
+ - Updated for ``statemachine.StringList``.
* docutils/parsers/rst/tableparser.py:
@@ -255,6 +268,9 @@ Specific:
* docutils/parsers/rst/directives/references.py: Added to project.
Contains the "target-notes" directive.
+* docutils/parsers/rst/languages/de.py: Added to project; German
+ mappings by Engelbert Gruber.
+
* docutils/readers/__init__.py:
- Added support for the observer pattern from ``utils.Reporter``, in
@@ -351,6 +367,7 @@ Specific:
- Added an override on the "--footnote-references" option.
- Factored out ``HTMLTranslator.get_stylesheet_reference()``.
- Added Docutils version to "generator" meta tag.
+ - Added a "DO NOT EDIT THIS FILE" comment to generated HTML.
* docs/tools.txt:
@@ -481,6 +498,7 @@ Specific:
- Updated for new I/O classes.
- Added ``check_requirements()`` & ``pep_type_error()``.
- Added some exception handling.
+ - Added a "DO NOT EDIT THIS FILE" comment to generated HTML.
* tools/quicktest.py:
diff --git a/docs/dev/todo.txt b/docs/dev/todo.txt
index c35b210f5..8848d1208 100644
--- a/docs/dev/todo.txt
+++ b/docs/dev/todo.txt
@@ -304,6 +304,13 @@ General
both accented and unaccented entries in the ``bibliographic_fields``
mapping for versatility.
+* Add a "--strict-language" option & setting: no English fallback for
+ language-dependent features.
+
+* Add an "--input-language" option & setting? Specify a different
+ language module for input (bibliographic fields, directives) than
+ for output ("--language").
+
Documentation
-------------
diff --git a/docs/peps/pep-0258.txt b/docs/peps/pep-0258.txt
index 2ad422d75..e9df3c9a5 100644
--- a/docs/peps/pep-0258.txt
+++ b/docs/peps/pep-0258.txt
@@ -455,7 +455,8 @@ Docutils Package Structure
- Function "get_language(language_code)", returns matching
language module. (``docutils/languages/__init__.py``)
- - Module "docutils.languages.en" (English).
+ - Modules: en.py (English), de.py (German), fr.py (French), sk.py
+ (Slovak), sv.py (Swedish).
- Other languages to be added.
diff --git a/docutils/parsers/rst/tableparser.py b/docutils/parsers/rst/tableparser.py
index 6b2ffe3ee..35b52e578 100644
--- a/docutils/parsers/rst/tableparser.py
+++ b/docutils/parsers/rst/tableparser.py
@@ -131,7 +131,7 @@ class GridTableParser(TableParser):
head_body_separator_pat = re.compile(r'\+=[=+]+=\+ *$')
def setup(self, block):
- self.block = block[:] # make a copy; it may be modified
+ self.block = list(block) # make a copy; it may be modified
self.bottom = len(block) - 1
self.right = len(block[0]) - 1
self.head_body_sep = None
@@ -371,7 +371,7 @@ class SimpleTableParser(TableParser):
span_pat = re.compile('-[ -]*$')
def setup(self, block):
- self.block = block[:] # make a copy; it will be modified
+ self.block = list(block) # make a copy; it will be modified
# Convert top & bottom borders to column span underlines:
self.block[0] = self.block[0].replace('=', '-')
self.block[-1] = self.block[-1].replace('=', '-')
diff --git a/docutils/utils.py b/docutils/utils.py
index bbd08c6a2..a216e114a 100644
--- a/docutils/utils.py
+++ b/docutils/utils.py
@@ -378,7 +378,7 @@ def new_document(source, settings=None):
reporter = Reporter(source, settings.report_level, settings.halt_level,
settings.warning_stream, settings.debug)
document = nodes.document(settings, reporter, source=source)
- document.note_source(source)
+ document.note_source(source, -1)
return document
def clean_rcs_keywords(paragraph, keyword_substitutions):
diff --git a/test/test_parsers/test_rst/test_directives/test_include.py b/test/test_parsers/test_rst/test_directives/test_include.py
index d2b2191d5..613ecae39 100755
--- a/test/test_parsers/test_rst/test_directives/test_include.py
+++ b/test/test_parsers/test_rst/test_directives/test_include.py
@@ -21,6 +21,7 @@ def suite():
mydir = os.path.dirname(suite.func_code.co_filename)
include1 = os.path.join(mydir, 'include1.txt')
+include1rel = DocutilsTestSupport.utils.relative_path(None, include1)
include2 = os.path.join(mydir, 'include2.txt')
totest = {}
@@ -47,8 +48,8 @@ A paragraph.
<literal>
test_include.py
.
- <paragraph>
- A paragraph.
+ <paragraph>
+ A paragraph.
"""],
["""\
Include Test
@@ -71,7 +72,7 @@ A paragraph.
This file is used by ``test_include.py``.
<paragraph>
A paragraph.
-""" % DocutilsTestSupport.utils.relative_path(None, include1)],
+""" % include1rel],
["""\
Let's test the parse context.
@@ -132,7 +133,32 @@ Include Test
A paragraph.
""" % (include1, include1),
"""\
-"""],
+<document source="test data">
+ <section id="include-test" name="include test">
+ <title>
+ Include Test
+ <section dupname="inclusion 1" id="inclusion-1">
+ <title>
+ Inclusion 1
+ <paragraph>
+ This file is used by
+ <literal>
+ test_include.py
+ .
+ <section dupname="inclusion 1" id="id1">
+ <title>
+ Inclusion 1
+ <system_message backrefs="id1" level="1" line="2" source="%s" type="INFO">
+ <paragraph>
+ Duplicate implicit target name: "inclusion 1".
+ <paragraph>
+ This file is used by
+ <literal>
+ test_include.py
+ .
+ <paragraph>
+ A paragraph.
+""" % include1rel],
["""\
Include Test
============
@@ -146,7 +172,36 @@ Include Test
A paragraph.
""" % (include1, include1),
"""\
-"""],
+<document source="test data">
+ <section id="include-test" name="include test">
+ <title>
+ Include Test
+ <section dupname="inclusion 1" id="inclusion-1">
+ <title>
+ Inclusion 1
+ <paragraph>
+ This file is used by
+ <literal>
+ test_include.py
+ .
+ <transition>
+ <system_message level="3" line="12" source="test data" type="ERROR">
+ <paragraph>
+ Section may not end with a transition.
+ <section dupname="inclusion 1" id="id1">
+ <title>
+ Inclusion 1
+ <system_message backrefs="id1" level="1" line="2" source="%s" type="INFO">
+ <paragraph>
+ Duplicate implicit target name: "inclusion 1".
+ <paragraph>
+ This file is used by
+ <literal>
+ test_include.py
+ .
+ <paragraph>
+ A paragraph.
+""" % include1rel],
]
diff --git a/test/test_parsers/test_rst/test_substitutions.py b/test/test_parsers/test_rst/test_substitutions.py
index 84d87a33d..498439a09 100755
--- a/test/test_parsers/test_rst/test_substitutions.py
+++ b/test/test_parsers/test_rst/test_substitutions.py
@@ -200,13 +200,6 @@ No blank line after.
.. |invalid 2| there's no directive here
With some block quote text, line 1.
And some more, line 2.
- <system_message level="2" line="12" source="test data" type="WARNING">
- <paragraph>
- Explicit markup ends without a blank line; unexpected unindent.
- <block_quote>
- <paragraph>
- With some block quote text, line 1.
- And some more, line 2.
<system_message level="2" line="15" source="test data" type="WARNING">
<paragraph>
Substitution definition "invalid 3" empty or invalid.
diff --git a/test/test_readers/test_pep/test_rfc2822.py b/test/test_readers/test_pep/test_rfc2822.py
index 13d1c96ea..f13de16d2 100644
--- a/test/test_readers/test_pep/test_rfc2822.py
+++ b/test/test_readers/test_pep/test_rfc2822.py
@@ -260,6 +260,30 @@ Version:
Version
<field_body>
"""],
+["""\
+Authors: Me
+
+ Myself and I
+Version:
+""",
+"""\
+<document source="test data">
+ <field_list class="rfc2822">
+ <field>
+ <field_name>
+ Authors
+ <field_body>
+ <paragraph>
+ Me
+ <block_quote>
+ <paragraph>
+ Myself and I
+ <system_message level="2" line="4" source="test data" type="WARNING">
+ <paragraph>
+ Block quote ends without a blank line; unexpected unindent.
+ <paragraph>
+ Version:
+"""],
]
if __name__ == '__main__':
diff --git a/test/test_statemachine.py b/test/test_statemachine.py
index 4ff5993fb..4ca2a0144 100755
--- a/test/test_statemachine.py
+++ b/test/test_statemachine.py
@@ -157,7 +157,7 @@ class SMWSTests(unittest.TestCase):
self.assertEquals(len(self.sm.states['MockState'].transitions), 4)
def test_get_indented(self):
- self.sm.input_lines = testtext
+ self.sm.input_lines = statemachine.StringList(testtext)
self.sm.line_offset = -1
self.sm.next_line(3)
indented, offset, good = self.sm.get_known_indented(2)
@@ -182,7 +182,7 @@ class SMWSTests(unittest.TestCase):
self.failUnless(good)
def test_get_text_block(self):
- self.sm.input_lines = testtext
+ self.sm.input_lines = statemachine.StringList(testtext)
self.sm.line_offset = -1
self.sm.next_line()
textblock = self.sm.get_text_block()
@@ -192,7 +192,7 @@ class SMWSTests(unittest.TestCase):
self.assertEquals(textblock, testtext[2:4])
def test_get_text_block_flush_left(self):
- self.sm.input_lines = testtext
+ self.sm.input_lines = statemachine.StringList(testtext)
self.sm.line_offset = -1
self.sm.next_line()
textblock = self.sm.get_text_block(flush_left=1)
@@ -274,22 +274,10 @@ class MiscTests(unittest.TestCase):
s2l_string = "hello\tthere\thow are\tyou?\n\tI'm fine\tthanks.\n"
s2l_expected = ['hello there how are you?',
" I'm fine thanks."]
- indented_string = """\
- a
- literal
- block"""
-
def test_string2lines(self):
self.assertEquals(statemachine.string2lines(self.s2l_string),
self.s2l_expected)
- def test_extract_indented(self):
- block = statemachine.string2lines(self.indented_string)
- self.assertEquals(statemachine.extract_indented(block),
- ([s[6:] for s in block], 6, 1))
- self.assertEquals(statemachine.extract_indented(self.s2l_expected),
- ([], 0, 0))
-
if __name__ == '__main__':
unittest.main()
diff --git a/tools/pep2html.py b/tools/pep2html.py
index c74de27db..deb65c813 100755
--- a/tools/pep2html.py
+++ b/tools/pep2html.py
@@ -243,8 +243,6 @@ def fixfile(inpath, input_lines, outfile):
if line.strip() == LOCALVARS:
break
if line[0].strip():
- if line.strip() == LOCALVARS:
- break
if not need_pre:
print >> outfile, '</pre>'
print >> outfile, '<h3>%s</h3>' % line.strip()
diff --git a/tools/stylesheets/pep.css b/tools/stylesheets/pep.css
index 9ff72b162..5f055d2b9 100644
--- a/tools/stylesheets/pep.css
+++ b/tools/stylesheets/pep.css
@@ -22,8 +22,7 @@ Default cascading style sheet for the PEP HTML output of Docutils.
.navigation .navicon {
width: 150px ;
- height: 35 ;
- margin-bottom: 0em }
+ height: 35 }
.navigation .textlinks {
padding-left: 1em ;