docstring-checkins Mailing List for Docstring Processing System (Page 4)
Status: Pre-Alpha
Brought to you by:
goodger
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(53) |
Sep
(54) |
Oct
(26) |
Nov
(27) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(60) |
Feb
(85) |
Mar
(94) |
Apr
(40) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: David G. <go...@us...> - 2002-03-16 05:48:25
|
Update of /cvsroot/docstring/dps/test In directory usw-pr-cvs1:/tmp/cvs-serv20663/dps/test Modified Files: test_utils.py Log Message: updated Index: test_utils.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_utils.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_utils.py 13 Mar 2002 02:40:04 -0000 1.7 --- test_utils.py 16 Mar 2002 05:48:22 -0000 1.8 *************** *** 237,241 **** class ExtensionAttributeTests(unittest.TestCase): ! attributespec = {'a': int, 'bbb': float, 'cdef': lambda x: x} def test_assemble_attribute_dict(self): --- 237,242 ---- class ExtensionAttributeTests(unittest.TestCase): ! attributespec = {'a': int, 'bbb': float, 'cdef': (lambda x: x), ! 'empty': (lambda x: x)} def test_assemble_attribute_dict(self): *************** *** 262,269 **** '', nodes.field_name('', 'cdef'), nodes.field_body('', nodes.paragraph('', 'hol%s' % chr(224)))) self.assertEquals( utils.extract_extension_attributes(field_list, self.attributespec), ! {'a': 1, 'bbb': 2.0, 'cdef': ('hol%s' % chr(224))}) --- 263,322 ---- '', nodes.field_name('', 'cdef'), nodes.field_body('', nodes.paragraph('', 'hol%s' % chr(224)))) + field_list += nodes.field( + '', nodes.field_name('', 'empty'), nodes.field_body()) self.assertEquals( utils.extract_extension_attributes(field_list, self.attributespec), ! {'a': 1, 'bbb': 2.0, 'cdef': ('hol%s' % chr(224)), ! 'empty': None}) ! self.assertRaises(KeyError, utils.extract_extension_attributes, ! field_list, {}) ! field_list += nodes.field( ! '', nodes.field_name('', 'cdef'), ! nodes.field_body('', nodes.paragraph('', 'one'), ! nodes.paragraph('', 'two'))) ! self.assertRaises(utils.BadAttributeDataError, ! utils.extract_extension_attributes, ! field_list, self.attributespec) ! field_list[-1] = nodes.field( ! '', nodes.field_name('', 'cdef'), ! nodes.field_argument('', 'bad'), ! nodes.field_body('', nodes.paragraph('', 'no arguments'))) ! self.assertRaises(utils.BadAttributeError, ! utils.extract_extension_attributes, ! field_list, self.attributespec) ! field_list[-1] = nodes.field( ! '', nodes.field_name('', 'cdef'), ! nodes.field_body('', nodes.paragraph('', 'duplicate'))) ! self.assertRaises(utils.DuplicateAttributeError, ! utils.extract_extension_attributes, ! field_list, self.attributespec) ! field_list[-2] = nodes.field( ! '', nodes.field_name('', 'unkown'), ! nodes.field_body('', nodes.paragraph('', 'unknown'))) ! self.assertRaises(KeyError, utils.extract_extension_attributes, ! field_list, self.attributespec) ! ! ! class MiscFunctionTests(unittest.TestCase): ! ! names = [('a', 'a'), ('A', 'a'), ('A a A', 'a a a'), ! ('A a A a', 'a a a a'), ! (' AaA\n\r\naAa\tAaA\t\t', 'aaa aaa aaa')] ! ! def test_normname(self): ! for input, output in self.names: ! normed = utils.normname(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) |
From: David G. <go...@us...> - 2002-03-16 05:48:14
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv20596/dps/test/test_transforms Modified Files: test_hyperlinks.py Log Message: updated Index: test_hyperlinks.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_hyperlinks.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_hyperlinks.py 11 Mar 2002 03:25:54 -0000 1.6 --- test_hyperlinks.py 16 Mar 2002 05:48:11 -0000 1.7 *************** *** 42,46 **** direct external ! <target id="id1" name="direct" refuri="http://direct"> """], ["""\ --- 42,46 ---- direct external ! <target id="direct" name="direct" refuri="http://direct"> """], ["""\ *************** *** 56,61 **** indirect external ! <target id="id1" name="indirect" refuri="http://indirect"> ! <target id="id2" name="xtarget" refuri="http://indirect"> """], ["""\ --- 56,61 ---- indirect external ! <target id="indirect" name="indirect" refuri="http://indirect"> ! <target id="xtarget" name="xtarget" refuri="http://indirect"> """], ["""\ *************** *** 66,70 **** """\ <document> ! <target id="id1" name="direct"> <paragraph> <reference refname="direct"> --- 66,70 ---- """\ <document> ! <target id="direct" name="direct"> <paragraph> <reference refname="direct"> *************** *** 82,92 **** """\ <document> ! <target id="id1" name="ztarget"> <paragraph> <reference refname="ztarget"> indirect internal ! <target id="id2" name="indirect2" refname="ztarget"> ! <target id="id3" name="indirect" refname="ztarget"> """], ["""\ --- 82,92 ---- """\ <document> ! <target id="ztarget" name="ztarget"> <paragraph> <reference refname="ztarget"> indirect internal ! <target id="indirect2" name="indirect2" refname="ztarget"> ! <target id="indirect" name="indirect" refname="ztarget"> """], ["""\ *************** *** 100,104 **** """\ <document> ! <section id="id1" name="implicit"> <title> Implicit --- 100,104 ---- """\ <document> ! <section id="implicit" name="implicit"> <title> Implicit *************** *** 107,111 **** indirect internal ! <target id="id2" name="indirect" refname="implicit"> """], ["""\ --- 107,111 ---- indirect internal ! <target id="indirect" name="indirect" refname="implicit"> """], ["""\ *************** *** 124,136 **** """\ <document> ! <section dupname="implicit" id="id1"> <title> Implicit <paragraph> Duplicate implicit targets. ! <section dupname="implicit" id="id2"> <title> Implicit ! <system_message level="1" refid="id2" type="INFO"> <paragraph> Duplicate implicit target name: "implicit" --- 124,136 ---- """\ <document> ! <section dupname="implicit" id="implicit"> <title> Implicit <paragraph> Duplicate implicit targets. ! <section dupname="implicit" id="id1"> <title> Implicit ! <system_message level="1" refid="id1" type="INFO"> <paragraph> Duplicate implicit target name: "implicit" *************** *** 139,143 **** indirect internal ! <target id="id3" name="indirect" refname="implicit"> <system_message level="2" type="WARNING"> <paragraph> --- 139,143 ---- indirect internal ! <target id="indirect" name="indirect" refname="implicit"> <system_message level="2" type="WARNING"> <paragraph> *************** *** 167,172 **** <reference anonymous="1" refuri="http://indirect"> indirect external ! <target anonymous="1" id="id2" name="_:1:_" refuri="http://indirect"> ! <target id="id1" name="xtarget" refuri="http://indirect"> """], ["""\ --- 167,172 ---- <reference anonymous="1" refuri="http://indirect"> indirect external ! <target anonymous="1" id="id1" name="_:1:_" refuri="http://indirect"> ! <target id="xtarget" name="xtarget" refuri="http://indirect"> """], ["""\ *************** *** 191,199 **** """\ <document> ! <target id="id1" name="ztarget"> <paragraph> <reference anonymous="1" refname="ztarget"> indirect internal ! <target anonymous="1" id="id2" name="_:1:_" refname="ztarget"> """], ["""\ --- 191,199 ---- """\ <document> ! <target id="ztarget" name="ztarget"> <paragraph> <reference anonymous="1" refname="ztarget"> indirect internal ! <target anonymous="1" id="id1" name="_:1:_" refname="ztarget"> """], ["""\ *************** *** 212,222 **** """\ <document> ! <target dupname="ztarget" id="id1"> <paragraph> First ! <system_message level="2" refid="id2" type="WARNING"> <paragraph> Duplicate explicit target name: "ztarget" ! <target dupname="ztarget" id="id2"> <paragraph> Second --- 212,222 ---- """\ <document> ! <target dupname="ztarget" id="ztarget"> <paragraph> First ! <system_message level="2" refid="id1" type="WARNING"> <paragraph> Duplicate explicit target name: "ztarget" ! <target dupname="ztarget" id="id1"> <paragraph> Second *************** *** 224,228 **** <reference anonymous="1" refname="ztarget"> indirect internal ! <target anonymous="1" id="id3" name="_:1:_" refname="ztarget"> """], ]) --- 224,228 ---- <reference anonymous="1" refname="ztarget"> indirect internal ! <target anonymous="1" id="id2" name="_:1:_" refname="ztarget"> """], ]) *************** *** 238,242 **** """\ <document> ! <target id="id1" name="internal hyperlink"> <paragraph> This paragraph referenced. --- 238,242 ---- """\ <document> ! <target id="internal-hyperlink" name="internal hyperlink"> <paragraph> This paragraph referenced. *************** *** 260,265 **** """\ <document> ! <target id="id1" name="chained"> ! <target id="id2" name="internal hyperlink"> <paragraph> This paragraph referenced. --- 260,265 ---- """\ <document> ! <target id="chained" name="chained"> ! <target id="internal-hyperlink" name="internal hyperlink"> <paragraph> This paragraph referenced. *************** *** 283,287 **** """\ <document> ! <target id="id1" name="external hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> --- 283,287 ---- """\ <document> ! <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> *************** *** 295,300 **** """\ <document> ! <target id="id1" name="external hyperlink" refuri="http://uri"> ! <target id="id2" name="indirect target" refuri="http://uri"> <system_message level="1" type="INFO"> <paragraph> --- 295,300 ---- """\ <document> ! <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> ! <target id="indirect-target" name="indirect target" refuri="http://uri"> <system_message level="1" type="INFO"> <paragraph> *************** *** 310,315 **** """\ <document> ! <target id="id1" name="chained" refuri="http://uri"> ! <target id="id2" name="external hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> --- 310,315 ---- """\ <document> ! <target id="chained" name="chained" refuri="http://uri"> ! <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> *************** *** 329,334 **** """\ <document> ! <target id="id1" name="external hyperlink" refuri="http://uri"> ! <target id="id2" name="indirect hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> --- 329,334 ---- """\ <document> ! <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> ! <target id="indirect-hyperlink" name="indirect hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> *************** *** 345,351 **** """\ <document> ! <target id="id1" name="external hyperlink" refuri="http://uri"> ! <target id="id2" name="chained" refuri="http://uri"> ! <target id="id3" name="indirect hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> --- 345,351 ---- """\ <document> ! <target id="external-hyperlink" name="external hyperlink" refuri="http://uri"> ! <target id="chained" name="chained" refuri="http://uri"> ! <target id="indirect-hyperlink" name="indirect hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> *************** *** 372,381 **** """\ <document> ! <target anonymous="1" id="id2" name="_:1:_" refuri="http://full"> ! <target anonymous="1" id="id3" name="_:2:_" refuri="http://simplified"> ! <target anonymous="1" id="id4" name="_:3:_" refuri="http://simplified"> ! <target id="id1" name="external" refuri="http://indirect.external"> ! <target anonymous="1" id="id5" name="_:4:_" refuri="http://indirect.external"> ! <target anonymous="1" id="id6" name="_:5:_"> <paragraph> <reference anonymous="1" refuri="http://full"> --- 372,381 ---- """\ <document> ! <target anonymous="1" id="id1" name="_:1:_" refuri="http://full"> ! <target anonymous="1" id="id2" name="_:2:_" refuri="http://simplified"> ! <target anonymous="1" id="id3" name="_:3:_" refuri="http://simplified"> ! <target id="external" name="external" refuri="http://indirect.external"> ! <target anonymous="1" id="id4" name="_:4:_" refuri="http://indirect.external"> ! <target anonymous="1" id="id5" name="_:5:_"> <paragraph> <reference anonymous="1" refuri="http://full"> *************** *** 409,417 **** target 's (different URIs): ! <target dupname="target" id="id1" refuri="first"> ! <system_message level="2" refid="id2" type="WARNING"> <paragraph> Duplicate explicit target name: "target" ! <target dupname="target" id="id2" refuri="second"> """], ]) --- 409,417 ---- target 's (different URIs): ! <target dupname="target" id="target" refuri="first"> ! <system_message level="2" refid="id1" type="WARNING"> <paragraph> Duplicate explicit target name: "target" ! <target dupname="target" id="id1" refuri="second"> """], ]) |
From: David G. <go...@us...> - 2002-03-16 05:48:00
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv20506/dps/test/test_transforms Modified Files: test_footnotes.py Log Message: updated Index: test_footnotes.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_footnotes.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_footnotes.py 13 Mar 2002 02:39:54 -0000 1.10 --- test_footnotes.py 16 Mar 2002 05:47:58 -0000 1.11 *************** *** 39,43 **** <footnote_reference auto="1" refname="autolabel"> 1 ! <footnote auto="1" id="id1" name="autolabel"> <label> 1 --- 39,43 ---- <footnote_reference auto="1" refname="autolabel"> 1 ! <footnote auto="1" id="autolabel" name="autolabel"> <label> 1 *************** *** 121,135 **** 3 is a reference to the third auto-numbered footnote. ! <footnote auto="1" id="id1" name="first"> <label> 1 <paragraph> First auto-numbered footnote. ! <footnote auto="1" id="id2" name="second"> <label> 2 <paragraph> Second auto-numbered footnote. ! <footnote auto="1" id="id3" name="third"> <label> 3 --- 121,135 ---- 3 is a reference to the third auto-numbered footnote. ! <footnote auto="1" id="first" name="first"> <label> 1 <paragraph> First auto-numbered footnote. ! <footnote auto="1" id="second" name="second"> <label> 2 <paragraph> Second auto-numbered footnote. ! <footnote auto="1" id="third" name="third"> <label> 3 *************** *** 187,191 **** 3 should be 3, \n\ ! <problematic refid="id7"> [#]_ is one too many, --- 187,191 ---- 3 should be 3, \n\ ! <problematic refid="id4"> [#]_ is one too many, *************** *** 195,232 **** <footnote_reference auto="1" refname="six"> doesn't exist. ! <footnote auto="1" id="id5" name="1"> <label> 1 <paragraph> Auto-numbered footnote 1. ! <footnote auto="1" id="id1" name="two"> <label> 2 <paragraph> Auto-numbered footnote 2. ! <footnote auto="1" id="id6" name="3"> <label> 3 <paragraph> Auto-numbered footnote 3. ! <footnote auto="1" id="id2" name="four"> <label> 4 <paragraph> Auto-numbered footnote 4. ! <footnote auto="1" dupname="five" id="id3"> <label> 5 <paragraph> Auto-numbered footnote 5. ! <footnote auto="1" dupname="five" id="id4"> <label> 6 ! <system_message level="2" refid="id4" type="WARNING"> <paragraph> Duplicate explicit target name: "five" <paragraph> Auto-numbered footnote 5 again (duplicate). ! <system_message id="id7" level="3" type="ERROR"> <paragraph> Too many autonumbered footnote references: only 2 corresponding footnotes available. --- 195,232 ---- <footnote_reference auto="1" refname="six"> doesn't exist. ! <footnote auto="1" id="id2" name="1"> <label> 1 <paragraph> Auto-numbered footnote 1. ! <footnote auto="1" id="two" name="two"> <label> 2 <paragraph> Auto-numbered footnote 2. ! <footnote auto="1" id="id3" name="3"> <label> 3 <paragraph> Auto-numbered footnote 3. ! <footnote auto="1" id="four" name="four"> <label> 4 <paragraph> Auto-numbered footnote 4. ! <footnote auto="1" dupname="five" id="five"> <label> 5 <paragraph> Auto-numbered footnote 5. ! <footnote auto="1" dupname="five" id="id1"> <label> 6 ! <system_message level="2" refid="id1" type="WARNING"> <paragraph> Duplicate explicit target name: "five" <paragraph> Auto-numbered footnote 5 again (duplicate). ! <system_message id="id4" level="3" type="ERROR"> <paragraph> Too many autonumbered footnote references: only 2 corresponding footnotes available. *************** *** 248,257 **** <paragraph> manually numbered ! <footnote auto="1" id="id3" name="2"> <label> 2 <paragraph> auto-numbered ! <footnote auto="1" id="id2" name="label"> <label> 3 --- 248,257 ---- <paragraph> manually numbered ! <footnote auto="1" id="id2" name="2"> <label> 2 <paragraph> auto-numbered ! <footnote auto="1" id="label" name="label"> <label> 3 *************** *** 281,290 **** 1 . ! <footnote auto="1" id="id2" name="1"> <label> 1 <paragraph> Unlabeled autonumbered footnote. ! <footnote auto="1" id="id1" name="footnote"> <label> 2 --- 281,290 ---- 1 . ! <footnote auto="1" id="id1" name="1"> <label> 1 <paragraph> Unlabeled autonumbered footnote. ! <footnote auto="1" id="footnote" name="footnote"> <label> 2 *************** *** 332,336 **** 6 should be 6, \n\ ! <problematic refid="id8"> [#]_ is one too many, --- 332,336 ---- 6 should be 6, \n\ ! <problematic refid="id6"> [#]_ is one too many, *************** *** 344,381 **** <paragraph> Manually-numbered footnote 1. ! <footnote auto="1" id="id6" name="2"> <label> 2 <paragraph> Auto-numbered footnote 2. ! <footnote auto="1" id="id2" name="four"> <label> 4 <paragraph> Auto-numbered footnote 4. ! <footnote id="id3" name="3"> <label> 3 <paragraph> Manually-numbered footnote 3 ! <footnote auto="1" dupname="five" id="id4"> <label> 5 <paragraph> Auto-numbered footnote 5. ! <footnote auto="1" id="id7" name="6"> <label> 6 <paragraph> Auto-numbered footnote 6. ! <footnote auto="1" dupname="five" id="id5"> <label> 7 ! <system_message level="2" refid="id5" type="WARNING"> <paragraph> Duplicate explicit target name: "five" <paragraph> Auto-numbered footnote 5 again (duplicate). ! <system_message id="id8" level="3" type="ERROR"> <paragraph> Too many autonumbered footnote references: only 2 corresponding footnotes available. --- 344,381 ---- <paragraph> Manually-numbered footnote 1. ! <footnote auto="1" id="id4" name="2"> <label> 2 <paragraph> Auto-numbered footnote 2. ! <footnote auto="1" id="four" name="four"> <label> 4 <paragraph> Auto-numbered footnote 4. ! <footnote id="id2" name="3"> <label> 3 <paragraph> Manually-numbered footnote 3 ! <footnote auto="1" dupname="five" id="five"> <label> 5 <paragraph> Auto-numbered footnote 5. ! <footnote auto="1" id="id5" name="6"> <label> 6 <paragraph> Auto-numbered footnote 6. ! <footnote auto="1" dupname="five" id="id3"> <label> 7 ! <system_message level="2" refid="id3" type="WARNING"> <paragraph> Duplicate explicit target name: "five" <paragraph> Auto-numbered footnote 5 again (duplicate). ! <system_message id="id6" level="3" type="ERROR"> <paragraph> Too many autonumbered footnote references: only 2 corresponding footnotes available. |
From: David G. <go...@us...> - 2002-03-16 05:47:51
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv20429/dps/test/test_transforms Modified Files: test_doctitle.py Log Message: updated Index: test_doctitle.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_doctitle.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_doctitle.py 11 Mar 2002 23:50:08 -0000 1.7 --- test_doctitle.py 16 Mar 2002 05:47:48 -0000 1.8 *************** *** 38,42 **** """, """\ ! <document id="id1" name="title"> <title> Title --- 38,42 ---- """, """\ ! <document id="title" name="title"> <title> Title *************** *** 52,56 **** """, """\ ! <document id="id1" name="title"> <title> Title --- 52,56 ---- """, """\ ! <document id="title" name="title"> <title> Title *************** *** 70,74 **** <paragraph> Paragraph. ! <section id="id1" name="title"> <title> Title --- 70,74 ---- <paragraph> Paragraph. ! <section id="title" name="title"> <title> Title *************** *** 86,93 **** """, """\ ! <document id="id1" name="title"> <title> Title ! <subtitle id="id2" name="subtitle"> Subtitle <paragraph> --- 86,93 ---- """, """\ ! <document id="title" name="title"> <title> Title ! <subtitle id="subtitle" name="subtitle"> Subtitle <paragraph> *************** *** 101,105 **** """, """\ ! <document id="id1" name="title"> <title> Title --- 101,105 ---- """, """\ ! <document id="title" name="title"> <title> Title *************** *** 123,127 **** """, """\ ! <document id="id1" name="long title"> <title> Long Title --- 123,127 ---- """, """\ ! <document id="long-title" name="long title"> <title> Long Title *************** *** 154,158 **** """, """\ ! <document id="id1" name="title 1"> <title> Title 1 --- 154,158 ---- """, """\ ! <document id="title-1" name="title 1"> <title> Title 1 *************** *** 161,170 **** <paragraph> Paragraph 1. ! <section id="id2" name="title 2"> <title> Title 2 <paragraph> Paragraph 2. ! <section id="id3" name="title 3"> <title> Title 3 --- 161,170 ---- <paragraph> Paragraph 1. ! <section id="title-2" name="title 2"> <title> Title 2 <paragraph> Paragraph 2. ! <section id="title-3" name="title 3"> <title> Title 3 |
From: David G. <go...@us...> - 2002-03-16 05:47:25
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv20271/dps/test/test_transforms Added Files: test_contents.py Log Message: Tests for generated tables of contents. --- NEW FILE: test_contents.py --- #! /usr/bin/env python """ :Author: David Goodger :Contact: go...@us... :Revision: $Revision: 1.1 $ :Date: $Date: 2002/03/16 05:47:22 $ :Copyright: This module has been placed in the public domain. Tests for dps.transforms.components.Contents. """ import DPSTestSupport from dps.transforms.universal import LastReaderPending import UnitTestFolder try: from restructuredtext import Parser except ImportError: from dps.parsers.restructuredtext import Parser def suite(): parser = Parser() s = DPSTestSupport.TransformTestSuite(parser) s.generateTests(totest) return s totest = {} totest['tables_of_contents'] = ((LastReaderPending,), [ ["""\ .. contents:: Title 1 ======= Paragraph 1. Title 2 ------- Paragraph 2. Title 3 ``````` Paragraph 3. Title 4 ------- Paragraph 4. """, """\ <document> <topic class="contents"> <title> Contents <bullet_list> <list_item id="id1"> <paragraph> <reference refid="title-1"> Title 1 <bullet_list> <list_item id="id2"> <paragraph> <reference refid="title-2"> Title 2 <bullet_list> <list_item id="id3"> <paragraph> <reference refid="title-3"> Title 3 <list_item id="id4"> <paragraph> <reference refid="title-4"> Title 4 <section id="title-1" name="title 1"> <title refid="id1"> Title 1 <paragraph> Paragraph 1. <section id="title-2" name="title 2"> <title refid="id2"> Title 2 <paragraph> Paragraph 2. <section id="title-3" name="title 3"> <title refid="id3"> Title 3 <paragraph> Paragraph 3. <section id="title-4" name="title 4"> <title refid="id4"> Title 4 <paragraph> Paragraph 4. """], ["""\ .. contents:: Table of Contents Title 1 ======= Paragraph 1. Title 2 ------- Paragraph 2. """, """\ <document> <topic class="contents"> <title> Table of Contents <bullet_list> <list_item id="id1"> <paragraph> <reference refid="title-1"> Title 1 <bullet_list> <list_item id="id2"> <paragraph> <reference refid="title-2"> Title 2 <section id="title-1" name="title 1"> <title refid="id1"> Title 1 <paragraph> Paragraph 1. <section id="title-2" name="title 2"> <title refid="id2"> Title 2 <paragraph> Paragraph 2. """], ["""\ .. contents:: :depth: 2 Title 1 ======= Paragraph 1. Title 2 ------- Paragraph 2. Title 3 ``````` Paragraph 3. Title 4 ------- Paragraph 4. """, """\ <document> <topic class="contents"> <title> Contents <bullet_list> <list_item id="id1"> <paragraph> <reference refid="title-1"> Title 1 <bullet_list> <list_item id="id2"> <paragraph> <reference refid="title-2"> Title 2 <list_item id="id3"> <paragraph> <reference refid="title-4"> Title 4 <section id="title-1" name="title 1"> <title refid="id1"> Title 1 <paragraph> Paragraph 1. <section id="title-2" name="title 2"> <title refid="id2"> Title 2 <paragraph> Paragraph 2. <section id="title-3" name="title 3"> <title> Title 3 <paragraph> Paragraph 3. <section id="title-4" name="title 4"> <title refid="id3"> Title 4 <paragraph> Paragraph 4. """], ["""\ Title 1 ======= .. contents:: :local: Paragraph 1. Title 2 ------- Paragraph 2. Title 3 ``````` Paragraph 3. Title 4 ------- Paragraph 4. """, """\ <document> <section id="title-1" name="title 1"> <title> Title 1 <topic class="contents"> <bullet_list> <list_item id="id1"> <paragraph> <reference refid="title-2"> Title 2 <bullet_list> <list_item id="id2"> <paragraph> <reference refid="title-3"> Title 3 <list_item id="id3"> <paragraph> <reference refid="title-4"> Title 4 <paragraph> Paragraph 1. <section id="title-2" name="title 2"> <title refid="id1"> Title 2 <paragraph> Paragraph 2. <section id="title-3" name="title 3"> <title refid="id2"> Title 3 <paragraph> Paragraph 3. <section id="title-4" name="title 4"> <title refid="id3"> Title 4 <paragraph> Paragraph 4. """], ["""\ .. contents:: Degenerate case, no table of contents generated. """, """\ <document> <paragraph> Degenerate case, no table of contents generated. """], ]) if __name__ == '__main__': import unittest unittest.main(defaultTest='suite') |
From: David G. <go...@us...> - 2002-03-13 02:48:37
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv4387/dps/spec Modified Files: dps-notes.txt Log Message: updated Index: dps-notes.txt =================================================================== RCS file: /cvsroot/docstring/dps/spec/dps-notes.txt,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** dps-notes.txt 11 Mar 2002 03:45:15 -0000 1.30 --- dps-notes.txt 13 Mar 2002 02:48:34 -0000 1.31 *************** *** 87,103 **** SGML-ID-friendly id's and a one-to-one mapping for later lookup. ! - Add conversion to nodes.document record-keeping code? Or as a new ! transform? ! - Use a "name mangling" scheme (like name "section title" becomes id ! "section_title", name "1" becomes id "footnote1")? Or use an ! arbitrary sequential id? How to do inter-document references in ! that case? ! - Perhaps combine name mangling with sequential ids? ! - ID everything? Or only named elements? ! - How to do inter-document references in *any* case? - Perhaps keep a name->id mapping file? This could be stored --- 87,104 ---- SGML-ID-friendly id's and a one-to-one mapping for later lookup. ! - Implement a "name mangling" scheme: name "section title" becomes ! id "section_title", name "1" becomes id "footnote1" (or just ! "1"?). ! - Whenever possible, use the "name mangling" scheme. When that's ! not possible (duplicate names, no name), and use an arbitrary ! sequential id. ! - ID as required. ! - Remove dependency on names as sole distinguishing characteristic. ! Use IDs instead. ! - Perhaps get rid of "name" attributes altoghether? - Perhaps keep a name->id mapping file? This could be stored *************** *** 105,108 **** --- 106,112 ---- new entries. ("Persistent ID mapping"?) + - When resolving reference IDs from names, we must check for + non-existent mappings. In the Writer or in a transform? + - Considerations for an HTML Writer [#]_: *************** *** 121,127 **** __ http://www.webreference.com/dev/html4nsie/index.html - - The Reporter needs another threshold writers. Use warninglevel as a - default. - Coding Conventions --- 125,128 ---- *************** *** 405,408 **** --- 406,410 ---- transforms. (CamelCase only or unrestricted?) Lazy indentation? - Web Page: As standalone, but recognize meta fields as meta tags. + Support for templates of some sort? (After <body>, before </body>?) - FAQ: Structured "question & answer(s)" constructs. - Compound document: Merge chapters into a book. Master TOC file? *************** *** 477,516 **** - Multiple files & directories - Objects in memory - - - Mixing Automatic and Manual Footnote Numbering - ============================================== - - [David] - I'm re-examining (for validity) what I wrote in the spec: - - Automatic footnote numbering may not be mixed with manual footnote - numbering; it would cause numbering and referencing conflicts. - - Would such mixing inevitably cause conflicts? We could probably work - around potential conflicts with a decent algorithm. Should we? - Requires thought. Opinions? - - [Tony] - Well, I read that paragraph in the documentation, and decided that it - was in the category of "don't, in practice, care" so far as I was - concerned. This is the same category I put the forbidding of nested - inline markup - quite clearly one *can* do it, but equally clearly - it's a pain to implement, and not a terribly great gain, all things - considered. - - It's a category with the subtext "examine for correctness after we've - had some experience of people *using* reST in the wild". - - Thus, given there are lots of other things to do, I would tend to - leave it as-is (especially if you are able to *warn* people about it - if they do it by mistake). - - To my mind, being able to do ``[#thing]_`` probably give people enough - precision over footnotes whils still allowing autonumbering - the - *only* potential problem is when referring to a footnote in a - different document (and that, again, is something I would leave fallow - for the moment, although we know I tend to want to use roles as - annotation for that sort of thing). --- 479,482 ---- |
From: David G. <go...@us...> - 2002-03-13 02:48:30
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv4350/dps Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** HISTORY.txt 11 Mar 2002 03:45:08 -0000 1.46 --- HISTORY.txt 13 Mar 2002 02:48:27 -0000 1.47 *************** *** 126,132 **** - Reworked ``Reporter`` based on "log4j". - Added some docstrings. ! - Added 'parseattributes()', associated functions and exceptions. - Moved 'normname()' from restructuredtext.states. - Added ``newdocument()``: document Node creation. * dps/test_*.py: Moved to new test/ directory. --- 126,135 ---- - Reworked ``Reporter`` based on "log4j". - Added some docstrings. ! - Added 'extract_extension_attributes()', associated functions and ! exceptions. ! - Added 'extract_name_value()' & 'NameValueError' exception. - Moved 'normname()' from restructuredtext.states. - Added ``newdocument()``: document Node creation. + * dps/test_*.py: Moved to new test/ directory. |
From: David G. <go...@us...> - 2002-03-13 02:47:38
|
Update of /cvsroot/docstring/dps/dps/transforms In directory usw-pr-cvs1:/tmp/cvs-serv4101/dps/dps/transforms Modified Files: references.py Log Message: minor changes (warmup) Index: references.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/transforms/references.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** references.py 11 Mar 2002 03:40:58 -0000 1.10 --- references.py 13 Mar 2002 02:47:35 -0000 1.11 *************** *** 35,44 **** <target anonymous="1"> ! Corresponding references and targets are assigned names:: <paragraph> ! <reference anonymous="1" refname="_:1:_"> text ! <target anonymous="1" id="id1" name="_:1:_"> 2. Chained targets:: --- 35,44 ---- <target anonymous="1"> ! Corresponding references and targets are assigned ids:: <paragraph> ! <reference anonymous="1" refid="id1"> text ! <target anonymous="1" id="id1"> 2. Chained targets:: *************** *** 140,153 **** ref = self.doctree.anonymous_refs[i] ref['refname'] = name - #del ref['anonymous'] self.doctree.note_refname(ref) target = self.doctree.anonymous_targets[i] target['name'] = name ! #del target['anonymous'] self.doctree.note_implicit_target(target, self.doctree) if target.hasattr('refname'): self.doctree.note_indirect_target(target) ! if target.hasattr('refuri'): self.doctree.note_external_target(target) def resolve_chained_targets(self): --- 140,156 ---- ref = self.doctree.anonymous_refs[i] ref['refname'] = name self.doctree.note_refname(ref) target = self.doctree.anonymous_targets[i] target['name'] = name ! id = self.doctree.set_id(target) self.doctree.note_implicit_target(target, self.doctree) if target.hasattr('refname'): + #ref['refname'] = target['refname'] self.doctree.note_indirect_target(target) ! elif target.hasattr('refuri'): ! #ref['refuri'] = target['refuri'] self.doctree.note_external_target(target) + #else: + # ref['refid'] = id def resolve_chained_targets(self): *************** *** 318,325 **** <document> <paragraph> ! A labeled autonumbered footnote referece: <footnote_reference auto="1" refname="footnote"> <paragraph> ! An unlabeled autonumbered footnote referece: <footnote_reference auto="1"> <footnote auto="1"> --- 321,328 ---- <document> <paragraph> ! A labeled autonumbered footnote referece: <footnote_reference auto="1" refname="footnote"> <paragraph> ! An unlabeled autonumbered footnote referece: <footnote_reference auto="1"> <footnote auto="1"> *************** *** 340,348 **** <document> <paragraph> ! A labeled autonumbered footnote referece: <footnote_reference auto="1" refname="footnote"> 2 <paragraph> ! An unlabeled autonumbered footnote referece: <footnote_reference auto="1" refname="1"> 1 --- 343,351 ---- <document> <paragraph> ! A labeled autonumbered footnote referece: <footnote_reference auto="1" refname="footnote"> 2 <paragraph> ! An unlabeled autonumbered footnote referece: <footnote_reference auto="1" refname="1"> 1 *************** *** 364,368 **** auto-numbered footnote and reference are assigned name and refname attributes respectively, being the footnote number. ! After adding labels and reference text, the "auto" attributes can be ignored. --- 367,371 ---- auto-numbered footnote and reference are assigned name and refname attributes respectively, being the footnote number. ! After adding labels and reference text, the "auto" attributes can be ignored. *************** *** 373,377 **** symbols = [ ! # The first six entries below are from section 12.51 of # The Chicago Manual of Style, 14th edition. '*', # asterisk/star --- 376,380 ---- symbols = [ ! # Entries 1-4 and 6 below are from section 12.51 of # The Chicago Manual of Style, 14th edition. '*', # asterisk/star *************** *** 379,390 **** u'\u2021', # double dagger ‡ u'\u00A7', # section mark § - # (Should be parallels; perhaps u'\u2016' ‖? Not in HTML.) u'\u00B6', # paragraph mark (pilcrow) ¶ '#', # number sign # The entries below were chosen arbitrarily. u'\u2660', # spade suit ♠ - u'\u2663', # club suit ♣ u'\u2665', # heart suit ♥ u'\u2666', # diamond suit ♦ ] --- 382,393 ---- u'\u2021', # double dagger ‡ u'\u00A7', # section mark § u'\u00B6', # paragraph mark (pilcrow) ¶ + # (parallels ['||'] in CMoS) '#', # number sign # The entries below were chosen arbitrarily. u'\u2660', # spade suit ♠ u'\u2665', # heart suit ♥ u'\u2666', # diamond suit ♦ + u'\u2663', # club suit ♣ ] *************** *** 488,492 **** <document> <paragraph> ! The <substitution_reference refname="biohazard"> biohazard --- 491,495 ---- <document> <paragraph> ! The <substitution_reference refname="biohazard"> biohazard *************** *** 502,506 **** <document> <paragraph> ! The <image alt="biohazard" uri="biohazard.png"> symbol is deservedly scary-looking. --- 505,509 ---- <document> <paragraph> ! The <image alt="biohazard" uri="biohazard.png"> symbol is deservedly scary-looking. |
From: David G. <go...@us...> - 2002-03-13 02:43:51
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv3007/dps/dps Modified Files: utils.py Log Message: - Removed 'parseattributes()' in favour of 'extract_extension_attributes()' which uses field_list syntax. - Renamed exceptions. Index: utils.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/utils.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** utils.py 11 Mar 2002 03:37:55 -0000 1.17 --- utils.py 13 Mar 2002 02:43:47 -0000 1.18 *************** *** 36,50 **** Multiple reporting categories [#]_ may be set, each with its own warning ! and error thresholds, debugging switch, and warning stream. Categories are ! hierarchically-named strings that look like attribute references: 'spam', ! 'spam.eggs', 'neeeow.wum.ping'. The 'spam' category is the ancestor of ! 'spam.bacon.eggs'. Unset categories inherit stored values from their ! closest ancestor category that has been set. ! When a system message is generated, the stored values from its category ! (or ancestor if unset) are retrieved. The system message level is compared ! to the thresholds stored in the category, and a warning or error is ! generated as appropriate. Debug messages are produced iff the stored debug ! switch is on. Message output is sent to the stored warning stream. .. [#]_ The concept of "categories" was inspired by the log4j project: --- 36,55 ---- Multiple reporting categories [#]_ may be set, each with its own warning ! and error thresholds, debugging switch, and warning stream (collectively a ! `ConditionSet`). Categories are hierarchically-named strings that look ! like attribute references: 'spam', 'spam.eggs', 'neeeow.wum.ping'. The ! 'spam' category is the ancestor of 'spam.bacon.eggs'. Unset categories ! inherit stored conditions from their closest ancestor category that has ! been set. ! When a system message is generated, the stored conditions from its ! category (or ancestor if unset) are retrieved. The system message level is ! compared to the thresholds stored in the category, and a warning or error ! is generated as appropriate. Debug messages are produced iff the stored ! debug switch is on. Message output is sent to the stored warning stream. ! ! The default category is '' (empty string). By convention, Writers should ! retrieve reporting conditions from the 'writer' category (which, unless ! explicitly set, defaults to the conditions of the default category). .. [#]_ The concept of "categories" was inspired by the log4j project: *************** *** 178,236 **** ! class AttributeParsingError(Exception): pass ! class BadAttributeLineError(AttributeParsingError): pass ! class BadAttributeDataError(AttributeParsingError): pass ! class DuplicateAttributeError(AttributeParsingError): pass ! def parseattributes(lines, attributespec): """ ! Return a dictionary mapping attribute names to converted values. :Parameters: ! - `lines`: List of one-line strings of the form:: ! ! ['[name1=value1 name2=value2]', '[name3="value 3"]'] ! ! - `attributespec`: Dictionary mapping known attribute names to a conversion function such as `int` or `float`. :Exceptions: - `KeyError` for unknown attribute names. ! - `ValueError` for invalid attribute values (raised by conversion function). - `DuplicateAttributeError` for duplicate attributes. ! - `BadAttributeLineError` for input lines not enclosed in brackets. - `BadAttributeDataError` for invalid attribute data (missing name, missing data, bad quotes, etc.). """ ! attlist = extractattributes(lines) ! attdict = assembleattributes(attlist, attributespec) return attdict ! def extractattributes(lines): """ ! Return a list of attribute (name, value) pairs. :Parameter: ! `lines`: List of one-line strings of the form:: ! ! ['[name1=value1 name2=value2]', '[name3="value 3"]'] :Exceptions: ! - `BadAttributeLineError` for input lines not enclosed in brackets. - `BadAttributeDataError` for invalid attribute data (missing name, missing data, bad quotes, etc.). """ attlist = [] ! for line in lines: ! line = line.strip() ! if line[:1] != '[' or line[-1:] != ']': ! raise BadAttributeLineError( ! 'input line not enclosed in "[" and "]"') ! line = line[1:-1].strip() ! attlist += extract_name_value(line) return attlist def extract_name_value(line): """ --- 183,275 ---- ! class ExtensionAttributeError(Exception): pass ! class BadAttributeLineError(ExtensionAttributeError): pass ! class BadAttributeDataError(ExtensionAttributeError): pass ! class DuplicateAttributeError(ExtensionAttributeError): pass ! def extract_extension_attributes(field_list, attribute_spec): """ ! Return a dictionary mapping extension attribute names to converted values. :Parameters: ! - `field_list`: A flat field list without field arguments, where each ! field body consists of a single paragraph only. ! - `attribute_spec`: Dictionary mapping known attribute names to a conversion function such as `int` or `float`. :Exceptions: - `KeyError` for unknown attribute names. ! - `ValueError` for invalid attribute values (raised by the conversion function). - `DuplicateAttributeError` for duplicate attributes. ! - `BadAttributeError` for input lines not enclosed in brackets. - `BadAttributeDataError` for invalid attribute data (missing name, missing data, bad quotes, etc.). """ ! attlist = extract_attributes(field_list) ! attdict = assemble_attribute_dict(attlist, attribute_spec) return attdict ! def extract_attributes(field_list): """ ! Return a list of attribute (name, value) pairs from field names & bodies. :Parameter: ! `field_list`: A flat field list without field arguments, where each ! field body consists of a single paragraph only. :Exceptions: ! - `BadAttributeError` for input lines not enclosed in brackets.? - `BadAttributeDataError` for invalid attribute data (missing name, missing data, bad quotes, etc.). """ attlist = [] ! for field in field_list: ! if len(field) != 2: ! raise BadAttributeError( ! 'extension attribute field may not contain field arguments') ! name = field[0].astext().lower() ! body = field[1] ! if len(body) != 1 or not isinstance(body[0], nodes.paragraph) \ ! or len(body[0]) != 1 or not isinstance(body[0][0], nodes.Text): ! raise BadAttributeDataError( ! 'extension attribute field body may consist of\n' ! 'a single paragraph only (attribute "%s")' % name) ! data = body[0][0].astext() ! attlist.append((name, data)) return attlist + def assemble_attribute_dict(attlist, attspec): + """ + Return a mapping of attribute names to values. + + :Parameters: + - `attlist`: A list of (name, value) pairs (the output of + `extract_attributes()`). + - `attspec`: Dictionary mapping known attribute names to a + conversion function such as `int` or `float`. + + :Exceptions: + - `KeyError` for unknown attribute names. + - `DuplicateAttributeError` for duplicate attributes. + - `ValueError` for invalid attribute values (raised by conversion + function). + """ + attributes = {} + for name, value in attlist: + convertor = attspec[name] # raises KeyError if unknown + if attributes.has_key(name): + raise DuplicateAttributeError('duplicate attribute "%s"' % name) + try: + attributes[name] = convertor(value) + except ValueError, detail: + raise ValueError('(attribute "%s") %s' % (name, detail)) + return attributes + + + class NameValueError(Exception): pass + + def extract_name_value(line): """ *************** *** 238,243 **** :Exception: ! `BadAttributeDataError` for invalid attribute data (missing name, ! missing data, bad quotes, etc.). """ attlist = [] --- 277,282 ---- :Exception: ! `NameValueError` for invalid input (missing name, missing data, bad ! quotes, etc.). """ attlist = [] *************** *** 245,265 **** equals = line.find('=') if equals == -1: ! raise BadAttributeDataError('missing "="') attname = line[:equals].strip() if equals == 0 or not attname: ! raise BadAttributeDataError( 'missing attribute name before "="') line = line[equals+1:].lstrip() if not line: ! raise BadAttributeDataError( 'missing value after "%s="' % attname) if line[0] in '\'"': endquote = line.find(line[0], 1) if endquote == -1: ! raise BadAttributeDataError( 'attribute "%s" missing end quote (%s)' % (attname, line[0])) if len(line) > endquote + 1 and line[endquote + 1].strip(): ! raise BadAttributeDataError( 'attribute "%s" end quote (%s) not followed by ' 'whitespace' % (attname, line[0])) --- 284,304 ---- equals = line.find('=') if equals == -1: ! raise NameValueError('missing "="') attname = line[:equals].strip() if equals == 0 or not attname: ! raise NameValueError( 'missing attribute name before "="') line = line[equals+1:].lstrip() if not line: ! raise NameValueError( 'missing value after "%s="' % attname) if line[0] in '\'"': endquote = line.find(line[0], 1) if endquote == -1: ! raise NameValueError( 'attribute "%s" missing end quote (%s)' % (attname, line[0])) if len(line) > endquote + 1 and line[endquote + 1].strip(): ! raise NameValueError( 'attribute "%s" end quote (%s) not followed by ' 'whitespace' % (attname, line[0])) *************** *** 277,303 **** return attlist - def assembleattributes(attlist, attributespec): - """ - Return a mapping of attribute names to values. - - :Parameters: - - `attlist`: A list of (name, value) pairs (the output of - `extractattributes()`). - - `attributespec`: Dictionary mapping known attribute names to a - conversion function such as `int` or `float`. - - :Exceptions: - - `KeyError` for unknown attribute names. - - `DuplicateAttributeError` for duplicate attributes. - - `ValueError` for invalid attribute values (raised by conversion - function). - """ - attributes = {} - for name, value in attlist: - convertor = attributespec[name] # raises KeyError if unknown - if attributes.has_key(name): - raise DuplicateAttributeError('duplicate attribute "%s"' % name) - attributes[name] = convertor(value) # raises ValueError if invalud - return attributes def normname(name): --- 316,319 ---- |
From: David G. <go...@us...> - 2002-03-13 02:40:45
|
Update of /cvsroot/docstring/dps/dps/writers In directory usw-pr-cvs1:/tmp/cvs-serv2184/dps/dps/writers Modified Files: html.py Log Message: reporter convention change Index: html.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/writers/html.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** html.py 11 Mar 2002 23:49:35 -0000 1.12 --- html.py 13 Mar 2002 02:40:42 -0000 1.13 *************** *** 605,610 **** def visit_system_message(self, node): ! if node['level'] < self.doctree.reporter['output'].warninglevel: ! # @@@ need another threshold for writer? gotta fix that raise nodes.SkipNode self.body.append(self.starttag(node, 'div', CLASS='system-message')) --- 605,609 ---- def visit_system_message(self, node): ! if node['level'] < self.doctree.reporter['writer'].warninglevel: raise nodes.SkipNode self.body.append(self.starttag(node, 'div', CLASS='system-message')) |
From: David G. <go...@us...> - 2002-03-13 02:40:08
|
Update of /cvsroot/docstring/dps/test In directory usw-pr-cvs1:/tmp/cvs-serv1975/dps/test Modified Files: test_utils.py Log Message: updated Index: test_utils.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_utils.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_utils.py 11 Mar 2002 03:26:25 -0000 1.6 --- test_utils.py 13 Mar 2002 02:40:04 -0000 1.7 *************** *** 12,16 **** import unittest, StringIO, sys ! from DPSTestSupport import utils try: import mypdb as pdb --- 12,16 ---- import unittest, StringIO, sys ! from DPSTestSupport import utils, nodes try: import mypdb as pdb *************** *** 211,260 **** ! class AttributeParserTests(unittest.TestCase): ! def test_extractattributes(self): ! self.assertRaises(utils.BadAttributeLineError, ! utils.extractattributes, ['hello']) ! self.assertRaises(utils.BadAttributeDataError, ! utils.extractattributes, ['[hello]']) ! self.assertRaises(utils.BadAttributeDataError, ! utils.extractattributes, ['[=hello]']) ! self.assertRaises(utils.BadAttributeDataError, ! utils.extractattributes, ['[hello=]']) ! self.assertRaises(utils.BadAttributeDataError, ! utils.extractattributes, ['[hello="]']) ! self.assertRaises(utils.BadAttributeDataError, ! utils.extractattributes, ['[hello="something]']) ! self.assertRaises(utils.BadAttributeDataError, ! utils.extractattributes, ! ['[hello="something"else]']) ! output = utils.extractattributes("""\ ! [att1=val1 att2=val2 att3="value number '3'"] ! [att4=val4]""".splitlines()) self.assertEquals(output, [('att1', 'val1'), ('att2', 'val2'), ('att3', "value number '3'"), ('att4', 'val4')]) attributespec = {'a': int, 'bbb': float, 'cdef': lambda x: x} ! def test_assembleattributes(self): ! input = utils.extractattributes(['[a=1 bbb=2.0 cdef=hol%s]' ! % chr(224)]) self.assertEquals( ! utils.assembleattributes(input, self.attributespec), {'a': 1, 'bbb': 2.0, 'cdef': ('hol%s' % chr(224))}) ! input = utils.extractattributes(['[a=1 b=2.0 c=hol%s]' ! % chr(224)]) ! self.assertRaises(KeyError, utils.assembleattributes, input, self.attributespec) ! input = utils.extractattributes(['[a=1 bbb=two cdef=hol%s]' ! % chr(224)]) ! self.assertRaises(ValueError, utils.assembleattributes, input, self.attributespec) ! def test_parseattributes(self): ! input = ['[a=1 bbb=2.0 cdef=hol%s]' % chr(224)] self.assertEquals( ! utils.parseattributes(input, self.attributespec), {'a': 1, 'bbb': 2.0, 'cdef': ('hol%s' % chr(224))}) --- 211,268 ---- ! class NameValueTests(unittest.TestCase): ! def test_extract_name_value(self): ! self.assertRaises(utils.NameValueError, utils.extract_name_value, ! 'hello') ! self.assertRaises(utils.NameValueError, utils.extract_name_value, ! 'hello') ! self.assertRaises(utils.NameValueError, utils.extract_name_value, ! '=hello') ! self.assertRaises(utils.NameValueError, utils.extract_name_value, ! 'hello=') ! self.assertRaises(utils.NameValueError, utils.extract_name_value, ! 'hello="') ! self.assertRaises(utils.NameValueError, utils.extract_name_value, ! 'hello="something') ! self.assertRaises(utils.NameValueError, utils.extract_name_value, ! 'hello="something"else') ! output = utils.extract_name_value( ! """att1=val1 att2=val2 att3="value number '3'" att4=val4""") self.assertEquals(output, [('att1', 'val1'), ('att2', 'val2'), ('att3', "value number '3'"), ('att4', 'val4')]) + + class ExtensionAttributeTests(unittest.TestCase): + attributespec = {'a': int, 'bbb': float, 'cdef': lambda x: x} ! def test_assemble_attribute_dict(self): ! input = utils.extract_name_value('a=1 bbb=2.0 cdef=hol%s' % chr(224)) self.assertEquals( ! utils.assemble_attribute_dict(input, self.attributespec), {'a': 1, 'bbb': 2.0, 'cdef': ('hol%s' % chr(224))}) ! input = utils.extract_name_value('a=1 b=2.0 c=hol%s' % chr(224)) ! self.assertRaises(KeyError, utils.assemble_attribute_dict, input, self.attributespec) ! input = utils.extract_name_value('a=1 bbb=two cdef=hol%s' % chr(224)) ! self.assertRaises(ValueError, utils.assemble_attribute_dict, input, self.attributespec) ! def test_extract_extension_attributes(self): ! field_list = nodes.field_list() ! field_list += nodes.field( ! '', nodes.field_name('', 'a'), ! nodes.field_body('', nodes.paragraph('', '1'))) ! field_list += nodes.field( ! '', nodes.field_name('', 'bbb'), ! nodes.field_body('', nodes.paragraph('', '2.0'))) ! field_list += nodes.field( ! '', nodes.field_name('', 'cdef'), ! nodes.field_body('', nodes.paragraph('', 'hol%s' % chr(224)))) self.assertEquals( ! utils.extract_extension_attributes(field_list, ! self.attributespec), {'a': 1, 'bbb': 2.0, 'cdef': ('hol%s' % chr(224))}) |
From: David G. <go...@us...> - 2002-03-13 02:39:57
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv1927/dps/test/test_transforms Modified Files: test_footnotes.py Log Message: updated Index: test_footnotes.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_footnotes.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_footnotes.py 11 Mar 2002 03:25:46 -0000 1.9 --- test_footnotes.py 13 Mar 2002 02:39:54 -0000 1.10 *************** *** 442,452 **** \n\ <footnote_reference auto="*" refid="id8"> ! \u2663 \n\ <footnote_reference auto="*" refid="id9"> ! \u2665 \n\ <footnote_reference auto="*" refid="id10"> ! \u2666 \n\ <footnote_reference auto="*" refid="id11"> --- 442,452 ---- \n\ <footnote_reference auto="*" refid="id8"> ! \u2665 \n\ <footnote_reference auto="*" refid="id9"> ! \u2666 \n\ <footnote_reference auto="*" refid="id10"> ! \u2663 \n\ <footnote_reference auto="*" refid="id11"> *************** *** 493,507 **** <footnote auto="*" id="id8"> <label> ! \u2663 <paragraph> Auto-symbol footnote 8. <footnote auto="*" id="id9"> <label> ! \u2665 <paragraph> Auto-symbol footnote 9. <footnote auto="*" id="id10"> <label> ! \u2666 <paragraph> Auto-symbol footnote 10. --- 493,507 ---- <footnote auto="*" id="id8"> <label> ! \u2665 <paragraph> Auto-symbol footnote 8. <footnote auto="*" id="id9"> <label> ! \u2666 <paragraph> Auto-symbol footnote 9. <footnote auto="*" id="id10"> <label> ! \u2663 <paragraph> Auto-symbol footnote 10. |
From: David G. <go...@us...> - 2002-03-11 23:50:11
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv7855/dps/test/test_transforms Modified Files: test_doctitle.py Log Message: updated Index: test_doctitle.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_doctitle.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_doctitle.py 20 Feb 2002 04:48:28 -0000 1.6 --- test_doctitle.py 11 Mar 2002 23:50:08 -0000 1.7 *************** *** 107,110 **** --- 107,113 ---- <paragraph> Title underline too short at line 2. + <literal_block> + Title + ==== <paragraph> Test short underline. *************** *** 126,129 **** --- 129,136 ---- <paragraph> Title overline too short at line 1. + <literal_block> + ======= + Long Title + ======= <paragraph> Test long title and space normalization. |
From: David G. <go...@us...> - 2002-03-11 23:49:38
|
Update of /cvsroot/docstring/dps/dps/writers In directory usw-pr-cvs1:/tmp/cvs-serv7661/dps/dps/writers Modified Files: html.py Log Message: Modified system_message title link (now two-tone!). Index: html.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/writers/html.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** html.py 11 Mar 2002 03:35:07 -0000 1.11 --- html.py 11 Mar 2002 23:49:35 -0000 1.12 *************** *** 610,616 **** self.body.append(self.starttag(node, 'div', CLASS='system-message')) if node.hasattr('refid'): ! self.body.append('<H3><A HREF="#%s">%s (level %s system message)' ! '</A></H3>\n' % (node['refid'], node['type'], ! node['level'])) else: self.body.append('<H3>%s (level %s system message)</H3>\n' --- 610,616 ---- self.body.append(self.starttag(node, 'div', CLASS='system-message')) if node.hasattr('refid'): ! self.body.append('<H3><A HREF="#%s">%s</A> ' ! '(level %s system message)</H3>\n' ! % (node['refid'], node['type'], node['level'])) else: self.body.append('<H3>%s (level %s system message)</H3>\n' |
From: David G. <go...@us...> - 2002-03-11 03:45:18
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv14502a/dps/spec Modified Files: dps-notes.txt Log Message: updated Index: dps-notes.txt =================================================================== RCS file: /cvsroot/docstring/dps/spec/dps-notes.txt,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** dps-notes.txt 8 Mar 2002 04:32:03 -0000 1.29 --- dps-notes.txt 11 Mar 2002 03:45:15 -0000 1.30 *************** *** 28,31 **** --- 28,35 ---- support graphics !-). + - PEP 258: + + - Mention 2.2-style "properties" with attribute docstrings. + - Document! *************** *** 68,76 **** - Remove complex import code. - Rename gpdi.dtd to docutils.dtd. - Provide a mechanism to pass options to Readers, Writers, and Parsers ! through dps.core.convert/Publisher? Or create custom Reader/Writer/Parser objects first, and pass *them* to ! convert/Publisher? - In reader.get_reader_class (& parser & writer too), should we be --- 72,81 ---- - Remove complex import code. - Rename gpdi.dtd to docutils.dtd. + - Rename writers/html.py to html4_css1.py. With aliases? - Provide a mechanism to pass options to Readers, Writers, and Parsers ! through dps.core.publish/Publisher? Or create custom Reader/Writer/Parser objects first, and pass *them* to ! publish/Publisher? - In reader.get_reader_class (& parser & writer too), should we be *************** *** 111,117 **** --- 116,127 ---- attribute (<HTML>?). + - "Class" attributes should have no underscores (CSS requirement). + .. [#] Source: `HTML 4.0 in Netscape and Explorer`__. __ http://www.webreference.com/dev/html4nsie/index.html + - The Reporter needs another threshold writers. Use warninglevel as a + default. + Coding Conventions *************** *** 298,302 **** Here's the latest project model:: ! 1,3,5 6,8 +--------+ +--------+ | READER | =======================> | WRITER | --- 308,319 ---- Here's the latest project model:: ! +--------------------------+ ! | Docutils: | ! | docutils.core.Publisher, | ! | docutils.core.publish() | ! +--------------------------+ ! / \ ! / \ ! 1,3,5 / \ 6,8 +--------+ +--------+ | READER | =======================> | WRITER | *************** *** 364,369 **** ``````` - ("Readers" may be renamed to "Directors".) - Most Readers will have to be told what parser to use. So far (see the list of examples below), only the Python Source Reader (PySource) will --- 381,384 ---- *************** *** 386,390 **** - PEP: RFC-822 headers, "PEP xxxx" and "RFC xxxx" conversion to URIs. Either interpret PEPs' indented sections or convert existing ! PEPs to reStructuredText. - Wiki: Global reference lookups of "wiki links" incorporated into transforms. (CamelCase only or unrestricted?) Lazy indentation? --- 401,405 ---- - PEP: RFC-822 headers, "PEP xxxx" and "RFC xxxx" conversion to URIs. Either interpret PEPs' indented sections or convert existing ! PEPs to reStructuredText (or both?). - Wiki: Global reference lookups of "wiki links" incorporated into transforms. (CamelCase only or unrestricted?) Lazy indentation? |
From: David G. <go...@us...> - 2002-03-11 03:45:11
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv14472/dps Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** HISTORY.txt 7 Mar 2002 04:06:54 -0000 1.45 --- HISTORY.txt 11 Mar 2002 03:45:08 -0000 1.46 *************** *** 93,96 **** --- 93,97 ---- - Removed "abstract" - Added "topic", "pending", "citation" and "citation_reference". + - Added support for system_message cross-references. * dps/roman.py: Added to project. Written by and courtesy of Mark *************** *** 218,224 **** allowing nested inline elements. - Removed generic 'directive'. ! - Added 'problematic', inline relative of 'system_warning'. - Added 'type' attribute to 'system_warning', removed 'warning'. ! - Changed "system_warning" to "system_message". - Reworked option lists. - Removed "abstract" --- 219,226 ---- allowing nested inline elements. - Removed generic 'directive'. ! - Added 'problematic', inline relative of 'system_message'. - Added 'type' attribute to 'system_warning', removed 'warning'. ! - Changed "system_warning" to "system_message"; added ! cross-reference attribute "refid". - Reworked option lists. - Removed "abstract" |
From: David G. <go...@us...> - 2002-03-11 03:43:28
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv14083/dps/dps Modified Files: nodes.py Log Message: - Added support for system_message cross-references (often to "problematic"). Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** nodes.py 7 Mar 2002 04:06:08 -0000 1.35 --- nodes.py 11 Mar 2002 03:43:26 -0000 1.36 *************** *** 581,601 **** if node.has_key('name'): name = node['name'] ! if self.nameids.has_key(name) \ ! and self.ids[self.nameids[name]].has_key('name'): ! msg = self.reporter.info( ! 'Multiple IDs for name "%s": "%s", "%s"' ! % (name, self.nameids[name], id)) ! msgnode += msg self.nameids[name] = id def note_implicit_target(self, targetnode, msgnode=None): if msgnode == None: msgnode = self.messages name = targetnode['name'] if self.explicit_targets.has_key(name) \ - or self.external_targets.has_key(name) \ or self.implicit_targets.has_key(name): msg = self.reporter.info( ! 'Duplicate implicit target name: "%s"' % name) msgnode += msg self.clear_target_names(name, self.implicit_targets) --- 581,602 ---- if node.has_key('name'): name = node['name'] ! #if self.nameids.has_key(name) \ ! # and self.ids[self.nameids[name]].has_key('name'): ! # msg = self.reporter.info( ! # 'Multiple IDs for name "%s": "%s", "%s"' ! # % (name, self.nameids[name], id)) ! # msgnode += msg self.nameids[name] = id + return id def note_implicit_target(self, targetnode, msgnode=None): if msgnode == None: msgnode = self.messages + id = self.set_id(targetnode, msgnode) name = targetnode['name'] if self.explicit_targets.has_key(name) \ or self.implicit_targets.has_key(name): msg = self.reporter.info( ! 'Duplicate implicit target name: "%s"' % name, refid=id) msgnode += msg self.clear_target_names(name, self.implicit_targets) *************** *** 603,611 **** targetnode['dupname'] = name self.implicit_targets[name] = targetnode - self.set_id(targetnode, msgnode) def note_explicit_target(self, targetnode, msgnode=None): if msgnode == None: msgnode = self.messages name = targetnode['name'] if self.explicit_targets.has_key(name): --- 604,612 ---- targetnode['dupname'] = name self.implicit_targets[name] = targetnode def note_explicit_target(self, targetnode, msgnode=None): if msgnode == None: msgnode = self.messages + id = self.set_id(targetnode, msgnode) name = targetnode['name'] if self.explicit_targets.has_key(name): *************** *** 618,622 **** level = 1 # just inform if refuri's identical msg = self.reporter.system_message( ! level, 'Duplicate explicit target name: "%s"' % name) msgnode += msg self.clear_target_names(name, self.explicit_targets, --- 619,624 ---- level = 1 # just inform if refuri's identical msg = self.reporter.system_message( ! level, 'Duplicate explicit target name: "%s"' % name, ! refid=id) msgnode += msg self.clear_target_names(name, self.explicit_targets, *************** *** 627,635 **** elif self.implicit_targets.has_key(name): msg = self.reporter.info( ! 'Duplicate implicit target name: "%s"' % name) msgnode += msg self.clear_target_names(name, self.implicit_targets) self.explicit_targets[name] = targetnode - self.set_id(targetnode, msgnode) def clear_target_names(self, name, *targetdicts): --- 629,636 ---- elif self.implicit_targets.has_key(name): msg = self.reporter.info( ! 'Duplicate implicit target name: "%s"' % name, refid=id) msgnode += msg self.clear_target_names(name, self.implicit_targets) self.explicit_targets[name] = targetnode def clear_target_names(self, name, *targetdicts): |
From: David G. <go...@us...> - 2002-03-11 03:41:01
|
Update of /cvsroot/docstring/dps/dps/transforms In directory usw-pr-cvs1:/tmp/cvs-serv13729/dps/dps/transforms Modified Files: references.py Log Message: fixes & additions (system_message cross-references) Index: references.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/transforms/references.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** references.py 8 Mar 2002 04:31:44 -0000 1.9 --- references.py 11 Mar 2002 03:40:58 -0000 1.10 *************** *** 35,45 **** <target anonymous="1"> ! Corresponding references and targets are assigned names, and the ! "anonymous" attributes are dropped:: <paragraph> ! <reference refname="_:1:_"> text ! <target id="id1" name="_:1:_"> 2. Chained targets:: --- 35,44 ---- <target anonymous="1"> ! Corresponding references and targets are assigned names:: <paragraph> ! <reference anonymous="1" refname="_:1:_"> text ! <target anonymous="1" id="id1" name="_:1:_"> 2. Chained targets:: *************** *** 141,149 **** ref = self.doctree.anonymous_refs[i] ref['refname'] = name ! del ref['anonymous'] self.doctree.note_refname(ref) target = self.doctree.anonymous_targets[i] target['name'] = name ! del target['anonymous'] self.doctree.note_implicit_target(target, self.doctree) if target.hasattr('refname'): --- 140,148 ---- ref = self.doctree.anonymous_refs[i] ref['refname'] = name ! #del ref['anonymous'] self.doctree.note_refname(ref) target = self.doctree.anonymous_targets[i] target['name'] = name ! #del target['anonymous'] self.doctree.note_implicit_target(target, self.doctree) if target.hasattr('refname'): *************** *** 167,190 **** name = target['name'] refname = target['refname'] ! try: ! reftarget = self.doctree.explicit_targets[refname] ! except KeyError: # @@@ something wrong here ! # @@@ give id for anonymous targets ! msg = self.doctree.reporter.warning( ! 'Indirect hyperlink target "%s" refers to target "%s", ' ! 'which does not exist.' % (name, refname)) ! self.doctree.messages += msg return - if reftarget.hasattr('name'): - if not reftarget.resolved and reftarget.hasattr('refname'): - self.one_indirect_target(reftarget) - if reftarget.hasattr('refuri'): - target['refuri'] = reftarget['refuri'] - del target['refname'] - self.doctree.note_external_target(target) - elif reftarget.hasattr('refname'): - target['refname'] = reftarget['refname'] target.resolved = 1 def one_indirect_reference(self, name, refname): try: --- 166,208 ---- name = target['name'] refname = target['refname'] ! if self.doctree.explicit_targets.has_key(refname): ! try: ! reftarget = self.doctree.explicit_targets[refname] ! except KeyError: ! self.nonexistent_indirect_target(name, refname, target) ! return ! if reftarget.hasattr('name'): ! if not reftarget.resolved and reftarget.hasattr('refname'): ! self.one_indirect_target(reftarget) # multiply indirect ! if reftarget.hasattr('refuri'): ! target['refuri'] = reftarget['refuri'] ! del target['refname'] ! self.doctree.note_external_target(target) ! elif reftarget.hasattr('refname'): ! target['refname'] = reftarget['refname'] ! #else: # @@@ ? ! # target['refid'] = reftarget['refid'] ! elif self.doctree.implicit_targets.has_key(refname): ! reftarget = self.doctree.implicit_targets[refname] ! try: ! target['refname'] = reftarget['name'] ! except KeyError: ! self.nonexistent_indirect_target(name, refname, target) ! return ! else: ! self.nonexistent_indirect_target(name, refname, target) return target.resolved = 1 + def nonexistent_indirect_target(self, name, refname, target): + if target.hasattr('anonymous'): + naming = '(id="%s")' % target['id'] + else: + naming = '"%s"' % name + msg = self.doctree.reporter.warning( + 'Indirect hyperlink target %s refers to target "%s", ' + 'which does not exist.' % (naming, refname)) + self.doctree.messages += msg + def one_indirect_reference(self, name, refname): try: *************** *** 199,210 **** if ref.resolved: continue ! try: ! ref['refname'] = refname ! except KeyError, instance: ! msg = self.doctree.reporter.error( ! 'Indirect hyperlink target "%s" has no "refname" ' ! 'attribute.' % name) ! self.doctree.messages += msg ! continue ref.resolved = 1 if isinstance(ref, nodes.target): --- 217,221 ---- if ref.resolved: continue ! ref['refname'] = refname ref.resolved = 1 if isinstance(ref, nodes.target): *************** *** 227,238 **** if ref.resolved: continue ! try: ! ref['refuri'] = refuri ! except KeyError, instance: ! msg = self.doctree.reporter.error( ! 'External hyperlink target "%s" has no "refuri" ' ! 'attribute.' % name) ! self.doctree.messages += msg ! continue del ref['refname'] ref.resolved = 1 --- 238,242 ---- if ref.resolved: continue ! ref['refuri'] = refuri del ref['refname'] ref.resolved = 1 *************** *** 433,442 **** 'corresponding footnotes available.' % len(self.autofootnote_labels)) self.doctree.messages += msg for ref in self.doctree.autofootnote_refs[i:]: if not (ref.resolved or ref.hasattr('refname')): ! ref.parent.replace( ! ref, nodes.problematic(ref.rawsource, ! ref.rawsource)) break ref.resolved = 1 --- 437,448 ---- 'corresponding footnotes available.' % len(self.autofootnote_labels)) + msgid = self.doctree.set_id(msg) self.doctree.messages += msg for ref in self.doctree.autofootnote_refs[i:]: if not (ref.resolved or ref.hasattr('refname')): ! prb = nodes.problematic(ref.rawsource, ref.rawsource, ! refid=msgid) ! ref.parent.replace(ref, prb) ! # @@@ insert reference to each prb in msg? break ref.resolved = 1 *************** *** 463,472 **** 'Too many symbol footnote references: only %s ' 'corresponding footnotes available.' % len(labels)) self.doctree.messages += msg for ref in self.doctree.symbol_footnote_refs[i:]: if not (ref.resolved or ref.hasattr('refid')): ! ref.parent.replace( ! ref, nodes.problematic(ref.rawsource, ! ref.rawsource)) break ref.resolved = 1 --- 469,480 ---- 'Too many symbol footnote references: only %s ' 'corresponding footnotes available.' % len(labels)) + msgid = self.set_id(msg) self.doctree.messages += msg for ref in self.doctree.symbol_footnote_refs[i:]: if not (ref.resolved or ref.hasattr('refid')): ! prb = nodes.problematic(ref.rawsource, ref.rawsource, ! refid=msgid) ! ref.parent.replace(ref, prb) ! # @@@ insert reference to each prb in msg? break ref.resolved = 1 *************** *** 514,519 **** msg = self.doctree.reporter.error( 'Undefined substitution referenced: "%s".' % refname) self.doctree.messages += msg ! ref.parent.replace(ref, nodes.problematic( ! ref.rawsource, '', *ref.getchildren())) self.doctree.substitution_refs = None # release replaced references --- 522,531 ---- msg = self.doctree.reporter.error( 'Undefined substitution referenced: "%s".' % refname) + msgid = self.doctree.set_id(msg) self.doctree.messages += msg ! prb = nodes.problematic( ! ref.rawsource, '', refid=msgid, *ref.getchildren()) ! prbid = self.doctree.set_id(prb) ! ref.parent.replace(ref, prb) ! msg['refid'] = prbid self.doctree.substitution_refs = None # release replaced references |
From: David G. <go...@us...> - 2002-03-11 03:38:59
|
Update of /cvsroot/docstring/dps/dps/transforms In directory usw-pr-cvs1:/tmp/cvs-serv13547/dps/dps/transforms Modified Files: universal.py Log Message: Messages: clear doctree.messages. Index: universal.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/transforms/universal.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** universal.py 8 Mar 2002 04:31:54 -0000 1.2 --- universal.py 11 Mar 2002 03:38:56 -0000 1.3 *************** *** 34,37 **** --- 34,38 ---- section += nodes.title('', 'Docutils System Messages') section += doctree.messages.getchildren() + doctree.messages[:] = [] doctree += section |
From: David G. <go...@us...> - 2002-03-11 03:37:58
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv13433/dps/dps Modified Files: utils.py Log Message: Reworked Reporter; added ConditionSet class. Index: utils.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/utils.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** utils.py 22 Feb 2002 02:02:57 -0000 1.16 --- utils.py 11 Mar 2002 03:37:55 -0000 1.17 *************** *** 55,96 **** """List of names for system message levels, indexed by level.""" ! def __init__(self, warninglevel, errorlevel, warningstream=None, debug=0): """ ! Initialize the `Reporter`'s default logging category. ! Parameters: ! - `warninglevel`: The level at or above which warning output will be ! sent to `warningstream`. ! - `errorlevel`: The level at or above which `SystemMessage` exceptions ! will be raised. ! - `debug`: Show debug (level=0) system messages? ! - `warningstream`: Where warning output is sent (`None` implies ! `sys.stderr`). """ ! if warningstream is None: ! warningstream = sys.stderr ! self.categories = {'': (debug, warninglevel, errorlevel, warningstream)} ! """Mapping of category names to levels. Default category is ''.""" ! def setcategory(self, category, warninglevel, errorlevel, ! warningstream=None, debug=0): ! if warningstream is None: ! warningstream = sys.stderr ! self.categories[category] = (debug, warninglevel, errorlevel, ! warningstream) ! def unsetcategory(self, category): if category and self.categories.has_key(category): del self.categories[category] ! def getcategory(self, category): while not self.categories.has_key(category): category = category[:category.rfind('.') + 1][:-1] return self.categories[category] ! def system_message(self, level, comment=None, children=[], category=''): """ Return a system_message object. --- 55,102 ---- """List of names for system message levels, indexed by level.""" ! def __init__(self, warninglevel, errorlevel, stream=None, debug=0): """ ! Initialize the `ConditionSet` forthe `Reporter`'s default category. ! :Parameters: ! - `warninglevel`: The level at or above which warning output will ! be sent to `stream`. ! - `errorlevel`: The level at or above which `SystemMessage` ! exceptions will be raised. ! - `debug`: Show debug (level=0) system messages? ! - `stream`: Where warning output is sent (`None` implies ! `sys.stderr`). """ ! if stream is None: ! stream = sys.stderr ! self.categories = {'': ConditionSet(debug, warninglevel, errorlevel, ! stream)} ! """Mapping of category names to conditions. Default category is ''.""" ! def setconditions(self, category, warninglevel, errorlevel, ! stream=None, debug=0): ! if stream is None: ! stream = sys.stderr ! self.categories[category] = ConditionSet(debug, warninglevel, ! errorlevel, stream) ! def unsetconditions(self, category): if category and self.categories.has_key(category): del self.categories[category] ! __delitem__ = unsetconditions ! ! def getconditions(self, category): while not self.categories.has_key(category): category = category[:category.rfind('.') + 1][:-1] return self.categories[category] ! __getitem__ = getconditions ! ! def system_message(self, level, comment=None, category='', ! *children, **attributes): """ Return a system_message object. *************** *** 99,104 **** """ msg = nodes.system_message(comment, level=level, ! type=self.levels[level], *children) ! debug, warninglevel, errorlevel, stream = self.getcategory(category) if level >= warninglevel or debug and level == 0: if category: --- 105,111 ---- """ msg = nodes.system_message(comment, level=level, ! type=self.levels[level], ! *children, **attributes) ! debug, warninglevel, errorlevel, stream = self[category].astuple() if level >= warninglevel or debug and level == 0: if category: *************** *** 110,114 **** return msg ! def debug(self, comment=None, children=[], category=''): """ Level-0, "DEBUG": an internal reporting issue. Typically, there is no --- 117,121 ---- return msg ! def debug(self, comment=None, category='', *children, **attributes): """ Level-0, "DEBUG": an internal reporting issue. Typically, there is no *************** *** 116,143 **** separately from the others. """ ! return self.system_message(0, comment, children, category) ! def info(self, comment=None, children=[], category=''): """ Level-1, "INFO": a minor issue that can be ignored. Typically there is no effect on processing, and level-1 system messages are not reported. """ ! return self.system_message(1, comment, children, category) ! def warning(self, comment=None, children=[], category=''): """ Level-2, "WARNING": an issue that should be addressed. If ignored, there may be unpredictable problems with the output. """ ! return self.system_message(2, comment, children, category) ! def error(self, comment=None, children=[], category=''): """ Level-3, "ERROR": an error that should be addressed. If ignored, the output will contain errors. """ ! return self.system_message(3, comment, children, category) ! def severe(self, comment=None, children=[], category=''): """ Level-4, "SEVERE": a severe error that must be addressed. If ignored, --- 123,154 ---- separately from the others. """ ! return self.system_message( ! 0, comment, category, *children, **attributes) ! def info(self, comment=None, category='', *children, **attributes): """ Level-1, "INFO": a minor issue that can be ignored. Typically there is no effect on processing, and level-1 system messages are not reported. """ ! return self.system_message( ! 1, comment, category, *children, **attributes) ! def warning(self, comment=None, category='', *children, **attributes): """ Level-2, "WARNING": an issue that should be addressed. If ignored, there may be unpredictable problems with the output. """ ! return self.system_message( ! 2, comment, category, *children, **attributes) ! def error(self, comment=None, category='', *children, **attributes): """ Level-3, "ERROR": an error that should be addressed. If ignored, the output will contain errors. """ ! return self.system_message( ! 3, comment, category, *children, **attributes) ! def severe(self, comment=None, category='', *children, **attributes): """ Level-4, "SEVERE": a severe error that must be addressed. If ignored, *************** *** 145,149 **** messages are turned into exceptions which halt processing. """ ! return self.system_message(4, comment, children, category) --- 156,179 ---- messages are turned into exceptions which halt processing. """ ! return self.system_message( ! 4, comment, category, *children, **attributes) ! ! ! class ConditionSet: ! ! """ ! A set of thresholds, switches, and streams corresponding to one `Reporter` ! category. ! """ ! ! def __init__(self, debug, warninglevel, errorlevel, stream): ! self.debug = debug ! self.warninglevel = warninglevel ! self.errorlevel = errorlevel ! self.stream = stream ! ! def astuple(self): ! return (self.debug, self.warninglevel, self.errorlevel, ! self.stream) *************** *** 166,170 **** conversion function such as `int` or `float`. ! :Raises: - `KeyError` for unknown attribute names. - `ValueError` for invalid attribute values (raised by conversion --- 196,200 ---- conversion function such as `int` or `float`. ! :Exceptions: - `KeyError` for unknown attribute names. - `ValueError` for invalid attribute values (raised by conversion *************** *** 188,192 **** ['[name1=value1 name2=value2]', '[name3="value 3"]'] ! :Raises: - `BadAttributeLineError` for input lines not enclosed in brackets. - `BadAttributeDataError` for invalid attribute data (missing name, --- 218,222 ---- ['[name1=value1 name2=value2]', '[name3="value 3"]'] ! :Exceptions: - `BadAttributeLineError` for input lines not enclosed in brackets. - `BadAttributeDataError` for invalid attribute data (missing name, *************** *** 207,212 **** Return a list of (name, value) from a line of the form "name=value ...". ! :Raises: `BadAttributeDataError` for invalid attribute data (missing name, ! missing data, bad quotes, etc.). """ attlist = [] --- 237,243 ---- Return a list of (name, value) from a line of the form "name=value ...". ! :Exception: ! `BadAttributeDataError` for invalid attribute data (missing name, ! missing data, bad quotes, etc.). """ attlist = [] *************** *** 256,260 **** conversion function such as `int` or `float`. ! :Raises: - `KeyError` for unknown attribute names. - `DuplicateAttributeError` for duplicate attributes. --- 287,291 ---- conversion function such as `int` or `float`. ! :Exceptions: - `KeyError` for unknown attribute names. - `DuplicateAttributeError` for duplicate attributes. *************** *** 275,280 **** def newdocument(languagecode='en', warninglevel=2, errorlevel=4, ! warningstream=None, debug=0): ! reporter = Reporter(warninglevel, errorlevel, warningstream, debug) document = nodes.document(languagecode=languagecode, reporter=reporter) return document --- 306,311 ---- def newdocument(languagecode='en', warninglevel=2, errorlevel=4, ! stream=None, debug=0): ! reporter = Reporter(warninglevel, errorlevel, stream, debug) document = nodes.document(languagecode=languagecode, reporter=reporter) return document |
From: David G. <go...@us...> - 2002-03-11 03:35:10
|
Update of /cvsroot/docstring/dps/dps/writers In directory usw-pr-cvs1:/tmp/cvs-serv13130/dps/dps/writers Modified Files: html.py Log Message: Fixed tables & docinfo. Added problematic <-> system_message cross-references. Index: html.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/writers/html.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** html.py 8 Mar 2002 04:32:05 -0000 1.10 --- html.py 11 Mar 2002 03:35:07 -0000 1.11 *************** *** 242,249 **** def visit_docinfo_item(self, node, name): ! self.head.append(self.starttag(node, 'meta', name=name, ! content=node.astext())) ! self.body.append('<TR><TD>\n' ! '<P>%s:</P>\n' '</TD><TD>\n' '<P>' % self.language.labels[name]) --- 242,250 ---- def visit_docinfo_item(self, node, name): ! self.head.append('<META NAME="%s" CONTENT="%s">\n' ! % (name, self.encode(node.astext()))) ! self.body.append(self.starttag(node, 'tr', '')) ! self.body.append('<TD>\n' ! '<P CLASS="docinfo-name">%s:</P>\n' '</TD><TD>\n' '<P>' % self.language.labels[name]) *************** *** 523,530 **** --- 524,537 ---- def visit_problematic(self, node): + if node.hasattr('refid'): + self.body.append('<A HREF="#%s">' % node['refid']) + self.context.append('</A>') + else: + self.context.append('') self.body.append(self.starttag(node, 'span', '', CLASS='problematic')) def depart_problematic(self, node): self.body.append('</SPAN>') + self.body.append(self.context.pop()) def visit_raw(self, node): *************** *** 598,607 **** def visit_system_message(self, node): ! if node['level'] < self.doctree.reporter.getcategory('output')[1]: ! # @@@ need another threshold? gotta fix that raise nodes.SkipNode self.body.append(self.starttag(node, 'div', CLASS='system-message')) ! self.body.append('<H3>%s (level %s system message)</H3>\n' ! % (node['type'], node['level'])) def depart_system_message(self, node): --- 605,619 ---- def visit_system_message(self, node): ! if node['level'] < self.doctree.reporter['output'].warninglevel: ! # @@@ need another threshold for writer? gotta fix that raise nodes.SkipNode self.body.append(self.starttag(node, 'div', CLASS='system-message')) ! if node.hasattr('refid'): ! self.body.append('<H3><A HREF="#%s">%s (level %s system message)' ! '</A></H3>\n' % (node['refid'], node['type'], ! node['level'])) ! else: ! self.body.append('<H3>%s (level %s system message)</H3>\n' ! % (node['type'], node['level'])) def depart_system_message(self, node): *************** *** 609,613 **** def visit_table(self, node): ! self.body.append(self.starttag(node, 'table', frame='box', rules='all')) def depart_table(self, node): --- 621,626 ---- def visit_table(self, node): ! self.body.append( ! self.starttag(node, 'table', frame='border', rules='all')) def depart_table(self, node): |
From: David G. <go...@us...> - 2002-03-11 03:26:54
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv12067/dps/spec Modified Files: gpdi.dtd Log Message: - Added "refid" attribute to "system_message" and "problematic". Index: gpdi.dtd =================================================================== RCS file: /cvsroot/docstring/dps/spec/gpdi.dtd,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** gpdi.dtd 7 Mar 2002 03:53:53 -0000 1.37 --- gpdi.dtd 11 Mar 2002 03:26:52 -0000 1.38 *************** *** 429,432 **** --- 429,433 ---- <!ATTLIST system_message %basic.atts; + %refid.att; level NMTOKEN #IMPLIED type CDATA #IMPLIED> *************** *** 494,498 **** <!ELEMENT problematic (%text.model;)> ! <!ATTLIST problematic %basic.atts;> --- 495,501 ---- <!ELEMENT problematic (%text.model;)> ! <!ATTLIST problematic ! %basic.atts; ! %refid.att;> |
From: David G. <go...@us...> - 2002-03-11 03:26:29
|
Update of /cvsroot/docstring/dps/test In directory usw-pr-cvs1:/tmp/cvs-serv12003/dps/test Modified Files: test_utils.py Log Message: updated Index: test_utils.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_utils.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_utils.py 21 Feb 2002 03:39:10 -0000 1.5 --- test_utils.py 11 Mar 2002 03:26:25 -0000 1.6 *************** *** 138,161 **** self.stream.truncate() self.reporter = utils.Reporter(2, 4, self.stream, 1) ! self.reporter.setcategory('lemon', 1, 3, self.stream, 0) def test_getset(self): ! self.reporter.setcategory('test', 5, 5, None, 0) ! self.assertEquals(self.reporter.getcategory('other'), (1, 2, 4, self.stream)) ! self.assertEquals(self.reporter.getcategory('test'), ! (0, 5, 5, sys.stderr)) ! self.assertEquals(self.reporter.getcategory('test.dummy'), (0, 5, 5, sys.stderr)) ! self.reporter.setcategory('test.dummy.spam', 1, 2, self.stream, 1) ! self.assertEquals(self.reporter.getcategory('test.dummy.spam'), ! (1, 1, 2, self.stream)) ! self.assertEquals(self.reporter.getcategory('test.dummy'), (0, 5, 5, sys.stderr)) ! self.assertEquals(self.reporter.getcategory('test.dummy.spam.eggs'), ! (1, 1, 2, self.stream)) ! self.reporter.unsetcategory('test.dummy.spam') ! self.assertEquals(self.reporter.getcategory('test.dummy.spam.eggs'), (0, 5, 5, sys.stderr)) def test_debug(self): --- 138,164 ---- self.stream.truncate() self.reporter = utils.Reporter(2, 4, self.stream, 1) ! self.reporter.setconditions('lemon', 1, 3, self.stream, 0) def test_getset(self): ! self.reporter.setconditions('test', 5, 5, None, 0) ! self.assertEquals(self.reporter.getconditions('other').astuple(), (1, 2, 4, self.stream)) ! self.assertEquals(self.reporter.getconditions('test').astuple(), (0, 5, 5, sys.stderr)) ! self.assertEquals(self.reporter.getconditions('test.dummy').astuple(), (0, 5, 5, sys.stderr)) ! self.reporter.setconditions('test.dummy.spam', 1, 2, self.stream, 1) ! self.assertEquals( ! self.reporter.getconditions('test.dummy.spam').astuple(), ! (1, 1, 2, self.stream)) ! self.assertEquals(self.reporter.getconditions('test.dummy').astuple(), (0, 5, 5, sys.stderr)) + self.assertEquals( + self.reporter.getconditions('test.dummy.spam.eggs').astuple(), + (1, 1, 2, self.stream)) + self.reporter.unsetconditions('test.dummy.spam') + self.assertEquals( + self.reporter.getconditions('test.dummy.spam.eggs').astuple(), + (0, 5, 5, sys.stderr)) def test_debug(self): |
From: David G. <go...@us...> - 2002-03-11 03:26:20
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv11981/dps/test/test_transforms Modified Files: test_substitutions.py Log Message: updated Index: test_substitutions.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_substitutions.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_substitutions.py 15 Feb 2002 22:45:58 -0000 1.4 --- test_substitutions.py 11 Mar 2002 03:26:16 -0000 1.5 *************** *** 50,57 **** <paragraph> Here's an ! <problematic> unknown substitution. ! <system_message level="3" type="ERROR"> <paragraph> Undefined substitution referenced: "unknown". --- 50,57 ---- <paragraph> Here's an ! <problematic id="id2" refid="id1"> unknown substitution. ! <system_message id="id1" level="3" refid="id2" type="ERROR"> <paragraph> Undefined substitution referenced: "unknown". |
From: David G. <go...@us...> - 2002-03-11 03:26:08
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv11962/dps/test/test_transforms Modified Files: test_messages.py Log Message: updated Index: test_messages.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_messages.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_messages.py 8 Mar 2002 04:26:22 -0000 1.2 --- test_messages.py 11 Mar 2002 03:26:05 -0000 1.3 *************** *** 42,46 **** <paragraph> This \n\ ! <problematic> unknown substitution will generate a system message, thanks to --- 42,46 ---- <paragraph> This \n\ ! <problematic id="id2" refid="id1"> unknown substitution will generate a system message, thanks to *************** *** 59,68 **** <title> Docutils System Messages ! <system_message level="3" type="ERROR"> <paragraph> Undefined substitution referenced: "unknown substitution". - <system_message level="3" type="ERROR"> - <paragraph> - Undefined substitution referenced: "unknown substitution". """], ]) --- 59,65 ---- <title> Docutils System Messages ! <system_message id="id1" level="3" refid="id2" type="ERROR"> <paragraph> Undefined substitution referenced: "unknown substitution". """], ]) |