diff options
| author | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2002-05-30 02:29:07 +0000 |
|---|---|---|
| committer | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2002-05-30 02:29:07 +0000 |
| commit | de0ee76ed6f25af5f23fd6e50cec5c5f027b73b8 (patch) | |
| tree | 06e1fc5a0d74de9ec454e485f39e5bb86d4841e0 /docutils | |
| parent | b4805f1f1210f96080d9e44edeaed5cf6971fae4 (diff) | |
| download | docutils-de0ee76ed6f25af5f23fd6e50cec5c5f027b73b8.tar.gz | |
updated
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@158 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
| -rw-r--r-- | docutils/docutils/transforms/__init__.py | 2 | ||||
| -rw-r--r-- | docutils/docutils/writers/__init__.py | 2 | ||||
| -rwxr-xr-x | docutils/test/alltests.py | 3 | ||||
| -rwxr-xr-x | docutils/test/test_nodes.py | 10 | ||||
| -rw-r--r-- | docutils/test/test_parsers/test_rst/__init__.py | 4 | ||||
| -rw-r--r-- | docutils/test/test_parsers/test_rst/test_directives/__init__.py | 4 | ||||
| -rwxr-xr-x | docutils/test/test_parsers/test_rst/test_inline_markup.py | 24 | ||||
| -rw-r--r-- | docutils/test/test_readers/test_pep/__init__.py | 4 | ||||
| -rwxr-xr-x | docutils/test/test_statemachine.py | 4 | ||||
| -rw-r--r-- | docutils/test/test_transforms/__init__.py | 5 | ||||
| -rwxr-xr-x | docutils/test/test_utils.py | 14 | ||||
| -rwxr-xr-x | docutils/tools/quicktest.py | 4 |
12 files changed, 55 insertions, 25 deletions
diff --git a/docutils/docutils/transforms/__init__.py b/docutils/docutils/transforms/__init__.py index 55e656bff..b2b9337d5 100644 --- a/docutils/docutils/transforms/__init__.py +++ b/docutils/docutils/transforms/__init__.py @@ -59,7 +59,7 @@ class Transform(Component): apply to the document as a whole, `startnode` is not set (i.e. its value is `None`).""" - self.language = languages.get_language(document.language_code) + self.language = languages.get_language(document.options.language_code) """Language module local to this document.""" def transform(self): diff --git a/docutils/docutils/writers/__init__.py b/docutils/docutils/writers/__init__.py index 35e5254c6..3c20068d4 100644 --- a/docutils/docutils/writers/__init__.py +++ b/docutils/docutils/writers/__init__.py @@ -52,7 +52,7 @@ class Writer(Component): def write(self, document, destination): self.document = document - self.language = languages.get_language(document.language_code) + self.language = languages.get_language(document.options.language_code) self.destination = destination self.transform() self.translate() diff --git a/docutils/test/alltests.py b/docutils/test/alltests.py index a01a60ee5..35cbe8dfa 100755 --- a/docutils/test/alltests.py +++ b/docutils/test/alltests.py @@ -17,7 +17,8 @@ import time # and setup outside of unittest. start = time.time() -import sys, os +import sys +import os class Tee: diff --git a/docutils/test/test_nodes.py b/docutils/test/test_nodes.py index 5f0a2b1a8..d14851740 100755 --- a/docutils/test/test_nodes.py +++ b/docutils/test/test_nodes.py @@ -91,6 +91,16 @@ class MiscTests(unittest.TestCase): node_class_names.append(x) self.assertEquals(node_class_names, nodes.node_class_names) + ids = [('a', 'a'), ('A', 'a'), ('', ''), ('a b \n c', 'a-b-c'), + ('a.b.c', 'a-b-c'), (' - a - b - c - ', 'a-b-c'), (' - ', ''), + (u'\u2020\u2066', ''), (u'a \xa7 b \u2020 c', 'a-b-c'), + ('1', ''), ('1abc', 'abc')] + + def test_make_id(self): + for input, output in self.ids: + normed = nodes.make_id(input) + self.assertEquals(normed, output) + class TreeCopyVisitorTests(unittest.TestCase): diff --git a/docutils/test/test_parsers/test_rst/__init__.py b/docutils/test/test_parsers/test_rst/__init__.py index 8df5d4778..2fe79c55c 100644 --- a/docutils/test/test_parsers/test_rst/__init__.py +++ b/docutils/test/test_parsers/test_rst/__init__.py @@ -1,4 +1,6 @@ -import os, os.path, sys +import os +import os.path +import sys sys.path.insert(0, os.path.abspath(os.curdir)) prev = '' diff --git a/docutils/test/test_parsers/test_rst/test_directives/__init__.py b/docutils/test/test_parsers/test_rst/test_directives/__init__.py index 8df5d4778..2fe79c55c 100644 --- a/docutils/test/test_parsers/test_rst/test_directives/__init__.py +++ b/docutils/test/test_parsers/test_rst/test_directives/__init__.py @@ -1,4 +1,6 @@ -import os, os.path, sys +import os +import os.path +import sys sys.path.insert(0, os.path.abspath(os.curdir)) prev = '' diff --git a/docutils/test/test_parsers/test_rst/test_inline_markup.py b/docutils/test/test_parsers/test_rst/test_inline_markup.py index 4a1c3e4c6..2212935a5 100755 --- a/docutils/test/test_parsers/test_rst/test_inline_markup.py +++ b/docutils/test/test_parsers/test_rst/test_inline_markup.py @@ -54,7 +54,8 @@ across lines* Inline emphasis start-string without end-string at line 1. """], ["""\ -'*emphasis*' but not '*' or '"*"' or x*2* or 2*x* or \\*args or * +'*emphasis*' and 1/*emphasis*/2 and 3-*emphasis*-4 and 5:*emphasis*:6 +but not '*' or '"*"' or x*2* or 2*x* or \\*args or * or *the\\* *stars\\\\\\* *inside* (however, '*args' will trigger a warning and may be problematic) @@ -67,7 +68,17 @@ what about *this**? ' <emphasis> emphasis - ' but not '*' or '"*"' or x*2* or 2*x* or *args or * + ' and 1/ + <emphasis> + emphasis + /2 and 3- + <emphasis> + emphasis + -4 and 5: + <emphasis> + emphasis + :6 + but not '*' or '"*"' or x*2* or 2*x* or *args or * or \n\ <emphasis> the* *stars\* *inside @@ -78,7 +89,7 @@ what about *this**? args' will trigger a warning and may be problematic) <system_message backrefs="id2" id="id1" level="2" type="WARNING"> <paragraph> - Inline emphasis start-string without end-string at line 4. + Inline emphasis start-string without end-string at line 5. <paragraph> what about \n\ <emphasis> @@ -360,7 +371,7 @@ ref__ ref """], ["""\ -ref_, r_, r_e-f_, and anonymousref__, but not _ref_ or -ref_ +ref_, r_, r_e-f_, -ref_, and anonymousref__, but not _ref_ """, """\ <document> @@ -373,10 +384,13 @@ ref_, r_, r_e-f_, and anonymousref__, but not _ref_ or -ref_ , \n\ <reference refname="r_e-f"> r_e-f + , - + <reference refname="ref"> + ref , and \n\ <reference anonymous="1"> anonymousref - , but not _ref_ or -ref_ + , but not _ref_ """], ] diff --git a/docutils/test/test_readers/test_pep/__init__.py b/docutils/test/test_readers/test_pep/__init__.py index 8df5d4778..2fe79c55c 100644 --- a/docutils/test/test_readers/test_pep/__init__.py +++ b/docutils/test/test_readers/test_pep/__init__.py @@ -1,4 +1,6 @@ -import os, os.path, sys +import os +import os.path +import sys sys.path.insert(0, os.path.abspath(os.curdir)) prev = '' diff --git a/docutils/test/test_statemachine.py b/docutils/test/test_statemachine.py index 02dd1e69b..8c336ca78 100755 --- a/docutils/test/test_statemachine.py +++ b/docutils/test/test_statemachine.py @@ -10,7 +10,9 @@ Test module for statemachine.py. """ -import unittest, sys, re +import unittest +import sys +import re from DocutilsTestSupport import statemachine diff --git a/docutils/test/test_transforms/__init__.py b/docutils/test/test_transforms/__init__.py index 027d2f3bc..2fe79c55c 100644 --- a/docutils/test/test_transforms/__init__.py +++ b/docutils/test/test_transforms/__init__.py @@ -1,4 +1,6 @@ -import os, os.path, sys +import os +import os.path +import sys sys.path.insert(0, os.path.abspath(os.curdir)) prev = '' @@ -9,3 +11,4 @@ while sys.path[0] != prev: except ImportError: prev = sys.path[0] sys.path[0] = os.path.dirname(prev) +sys.path.pop(0) diff --git a/docutils/test/test_utils.py b/docutils/test/test_utils.py index 3f3b53db8..8383d49a1 100755 --- a/docutils/test/test_utils.py +++ b/docutils/test/test_utils.py @@ -10,7 +10,9 @@ Test module for utils.py. """ -import unittest, StringIO, sys +import unittest +import StringIO +import sys from DocutilsTestSupport import utils, nodes @@ -304,16 +306,6 @@ class MiscFunctionTests(unittest.TestCase): normed = utils.normalize_name(input) self.assertEquals(normed, output) - ids = [('a', 'a'), ('A', 'a'), ('', ''), ('a b \n c', 'a-b-c'), - ('a.b.c', 'a-b-c'), (' - a - b - c - ', 'a-b-c'), (' - ', ''), - (u'\u2020\u2066', ''), (u'a \xa7 b \u2020 c', 'a-b-c'), - ('1', ''), ('1abc', 'abc')] - - def test_id(self): - for input, output in self.ids: - normed = utils.id(input) - self.assertEquals(normed, output) - if __name__ == '__main__': unittest.main() diff --git a/docutils/tools/quicktest.py b/docutils/tools/quicktest.py index fab25adce..d76845023 100755 --- a/docutils/tools/quicktest.py +++ b/docutils/tools/quicktest.py @@ -10,7 +10,9 @@ :Copyright: This module has been placed in the public domain. """ -import sys, os, getopt +import sys +import os +import getopt import docutils.utils from docutils.parsers.rst import Parser |
