docstring-checkins Mailing List for Docstring Processing System (Page 7)
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-02-21 03:44:56
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv29730/dps/dps Modified Files: nodes.py Log Message: - Added debug trace to Node.walk() & Node.walkabout(). - Simplified system_message.astext(). Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** nodes.py 20 Feb 2002 04:17:36 -0000 1.30 --- nodes.py 21 Feb 2002 03:44:53 -0000 1.31 *************** *** 54,59 **** ``visit_...`` method for each `Node` subclass encountered. """ ! method = getattr(visitor, 'visit_' + self.__class__.__name__, ! visitor.unknown_visit) try: method(self) --- 54,60 ---- ``visit_...`` method for each `Node` subclass encountered. """ ! name = 'visit_' + self.__class__.__name__ ! method = getattr(visitor, name, visitor.unknown_visit) ! visitor.doctree.reporter.debug(name, category='nodes.Node.walk') try: method(self) *************** *** 77,82 **** and ``depart_...`` methods for each `Node` subclass encountered. """ ! method = getattr(visitor, 'visit_' + self.__class__.__name__, ! visitor.unknown_visit) try: method(self) --- 78,84 ---- and ``depart_...`` methods for each `Node` subclass encountered. """ ! name = 'visit_' + self.__class__.__name__ ! method = getattr(visitor, name, visitor.unknown_visit) ! visitor.doctree.reporter.debug(name, category='nodes.Node.walkabout') try: method(self) *************** *** 91,96 **** except SkipDeparture: return ! method = getattr(visitor, 'depart_' + self.__class__.__name__, ! visitor.unknown_departure) method(self) --- 93,99 ---- except SkipDeparture: return ! name = 'depart_' + self.__class__.__name__ ! method = getattr(visitor, name, visitor.unknown_departure) ! visitor.doctree.reporter.debug(name, category='nodes.Node.walkabout') method(self) *************** *** 763,768 **** def astext(self): ! return '%s [level %s] %s' % (self['type'], self['level'], ! Element.astext(self)) --- 766,771 ---- def astext(self): ! return '%s (%s) %s' % (self['type'], self['level'], ! Element.astext(self)) |
From: David G. <go...@us...> - 2002-02-21 03:41:34
|
Update of /cvsroot/docstring/dps/dps/writers In directory usw-pr-cvs1:/tmp/cvs-serv28682/dps/dps/writers Modified Files: html.py Log Message: progress Index: html.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/writers/html.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** html.py 20 Feb 2002 04:49:32 -0000 1.1 --- html.py 21 Feb 2002 03:41:31 -0000 1.2 *************** *** 2,6 **** """ ! :Authors: David Goodger :Contact: go...@us... :Revision: $Revision$ --- 2,6 ---- """ ! :Author: David Goodger :Contact: go...@us... :Revision: $Revision$ *************** *** 8,12 **** :Copyright: This module has been placed in the public domain. ! Hypertext Markup Language document tree Writer. """ --- 8,16 ---- :Copyright: This module has been placed in the public domain. ! Simple HyperText Markup Language document tree Writer. ! ! The output uses the HTML 4.01 strict.dtd and contains a minimum of formatting ! information. A cascading style sheet "default.css" is required for proper ! viewing with a browser. """ *************** *** 58,62 **** return text ! def starttag(self, node, tagname, **attrs): attlist = attrs.items() for att in ('id', 'class'): --- 62,66 ---- return text ! def starttag(self, node, tagname, suffix='\n', **attrs): attlist = attrs.items() for att in ('id', 'class'): *************** *** 64,70 **** attlist.append((att, node[att])) attlist.sort() ! return '<%s>' % ' '.join([tagname.upper()] + ! ['%s="%s"' % (n.upper(), self.encode(v)) ! for n, v in attlist]) def visit_Text(self, node): --- 68,75 ---- attlist.append((att, node[att])) attlist.sort() ! return '<%s>%s' % (' '.join([tagname.upper()] + ! ['%s="%s"' % (n.upper(), self.encode(v)) ! for n, v in attlist]), ! suffix) def visit_Text(self, node): *************** *** 75,85 **** def visit_abstract(self, node): ! self.body.append(self.starttag(node, 'div', CLASS='abstract') ! + '\n<BLOCKQUOTE>\n') ! self.body.append('<H3>' + self.language.bibliographic_labels['abstract'] + '</H3>\n') def depart_abstract(self, node): ! self.body.append('</BLOCKQUOTE>\n</DIV>\n') def visit_attention(self, node): --- 80,90 ---- def visit_abstract(self, node): ! self.body.append(self.starttag(node, 'div', CLASS='abstract')) ! self.body.append('<H3>' ! + self.language.bibliographic_labels['abstract'] + '</H3>\n') def depart_abstract(self, node): ! self.body.append('</DIV>\n') def visit_attention(self, node): *************** *** 91,95 **** def visit_author(self, node): self.head.append(self.starttag(node, 'meta', name='author', ! content=node.astext()) + '\n') def depart_author(self, node): --- 96,100 ---- def visit_author(self, node): self.head.append(self.starttag(node, 'meta', name='author', ! content=node.astext())) def depart_author(self, node): *************** *** 110,114 **** def visit_bullet_list(self, node): self.body.append(self.starttag(node, 'ul', ! CLASS='bullet'+node['bullet']) + '\n') def depart_bullet_list(self, node): --- 115,119 ---- def visit_bullet_list(self, node): self.body.append(self.starttag(node, 'ul', ! CLASS='bullet'+node['bullet'])) def depart_bullet_list(self, node): *************** *** 128,135 **** def visit_classifier(self, node): ! pass def depart_classifier(self, node): ! pass def visit_colspec(self, node): --- 133,141 ---- def visit_classifier(self, node): ! self.body.append(' <SPAN CLASS="classifier_delimiter">:</SPAN> ') ! self.body.append(self.starttag(node, 'span', '', CLASS='classifier')) def depart_classifier(self, node): ! self.body.append('</SPAN>') def visit_colspec(self, node): *************** *** 153,157 **** def visit_copyright(self, node): self.head.append(self.starttag(node, 'meta', name='copyright', ! content=node.astext()) + '\n') def depart_copyright(self, node): --- 159,163 ---- def visit_copyright(self, node): self.head.append(self.starttag(node, 'meta', name='copyright', ! content=node.astext())) def depart_copyright(self, node): *************** *** 166,170 **** def visit_date(self, node): self.head.append(self.starttag(node, 'meta', name='date', ! content=node.astext()) + '\n') def depart_date(self, node): --- 172,176 ---- def visit_date(self, node): self.head.append(self.starttag(node, 'meta', name='date', ! content=node.astext())) def depart_date(self, node): *************** *** 172,185 **** def visit_definition(self, node): ! pass def depart_definition(self, node): ! pass def visit_definition_list(self, node): ! pass def depart_definition_list(self, node): ! pass def visit_definition_list_item(self, node): --- 178,192 ---- def visit_definition(self, node): ! self.body.append('</TERM>\n') ! self.body.append(self.starttag(node, 'dd')) def depart_definition(self, node): ! self.body.append('</DD>\n') def visit_definition_list(self, node): ! self.body.append(self.starttag(node, 'dl')) def depart_definition_list(self, node): ! self.body.append('</DL>\n') def visit_definition_list_item(self, node): *************** *** 209,213 **** def visit_document(self, node): ! self.body.append(self.starttag(node, 'div', CLASS='document') + '\n') def depart_document(self, node): --- 216,220 ---- def visit_document(self, node): ! self.body.append(self.starttag(node, 'div', CLASS='document')) def depart_document(self, node): *************** *** 293,297 **** def visit_image(self, node): ! pass def depart_image(self, node): --- 300,309 ---- def visit_image(self, node): ! attrs = node.attributes.copy() ! attrs['src'] = attrs['uri'] ! del attrs['uri'] ! if not attrs.has_key('alt'): ! attrs['alt'] = attrs['src'] ! self.body.append(self.starttag(node, 'img', '', **attrs)) def depart_image(self, node): *************** *** 323,327 **** def visit_list_item(self, node): ! self.body.append(self.starttag(node, 'li') + '\n') def depart_list_item(self, node): --- 335,339 ---- def visit_list_item(self, node): ! self.body.append(self.starttag(node, 'li')) def depart_list_item(self, node): *************** *** 347,351 **** def visit_meta(self, node): ! self.head.append(self.starttag(node, 'meta', **node.attributes) + '\n') def depart_meta(self, node): --- 359,363 ---- def visit_meta(self, node): ! self.head.append(self.starttag(node, 'meta', **node.attributes)) def depart_meta(self, node): *************** *** 389,393 **** def visit_paragraph(self, node): ! self.body.append(self.starttag(node, 'p')) def depart_paragraph(self, node): --- 401,405 ---- def visit_paragraph(self, node): ! self.body.append(self.starttag(node, 'p', '')) def depart_paragraph(self, node): *************** *** 395,399 **** def visit_problematic(self, node): ! self.body.append('<SPAN class="problematic">') def depart_problematic(self, node): --- 407,411 ---- def visit_problematic(self, node): ! self.body.append(self.starttag(node, 'span', '', CLASS='problematic')) def depart_problematic(self, node): *************** *** 420,424 **** def visit_section(self, node): self.sectionlevel += 1 ! self.body.append(self.starttag(node, 'div', CLASS='section') + '\n') def depart_section(self, node): --- 432,436 ---- def visit_section(self, node): self.sectionlevel += 1 ! self.body.append(self.starttag(node, 'div', CLASS='section')) def depart_section(self, node): *************** *** 445,449 **** def visit_substitution_definition(self, node): ! pass def depart_substitution_definition(self, node): --- 457,461 ---- def visit_substitution_definition(self, node): ! raise nodes.SkipChildren def depart_substitution_definition(self, node): *************** *** 457,461 **** def visit_subtitle(self, node): ! self.body.append(self.starttag(node, 'H2', CLASS='subtitle')) def depart_subtitle(self, node): --- 469,473 ---- def visit_subtitle(self, node): ! self.body.append(self.starttag(node, 'H2', '', CLASS='subtitle')) def depart_subtitle(self, node): *************** *** 487,493 **** def visit_term(self, node): ! pass def depart_term(self, node): pass --- 499,506 ---- def visit_term(self, node): ! self.body.append(self.starttag(node, 'dt', '')) def depart_term(self, node): + # leave the end tag to visit_definition, in case there's a classifier pass *************** *** 513,519 **** if self.sectionlevel == 0: self.head.append('<TITLE>%s</TITLE>\n' % self.encode(node.astext())) ! self.body.append(self.starttag(node, 'H1', CLASS='title')) else: ! self.body.append(self.starttag(node, 'H%s' % self.sectionlevel)) # @@@ >H6? --- 526,532 ---- if self.sectionlevel == 0: self.head.append('<TITLE>%s</TITLE>\n' % self.encode(node.astext())) ! self.body.append(self.starttag(node, 'H1', '', CLASS='title')) else: ! self.body.append(self.starttag(node, 'H%s' % self.sectionlevel, '')) # @@@ >H6? |
From: David G. <go...@us...> - 2002-02-21 03:39:13
|
Update of /cvsroot/docstring/dps/test In directory usw-pr-cvs1:/tmp/cvs-serv28011/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.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_utils.py 15 Feb 2002 22:45:30 -0000 1.4 --- test_utils.py 21 Feb 2002 03:39:10 -0000 1.5 *************** *** 37,41 **** """) self.assertEquals(self.stream.getvalue(), ! 'Reporter: DEBUG [level 0] debug output\n') def test_level1(self): --- 37,41 ---- """) self.assertEquals(self.stream.getvalue(), ! 'Reporter: DEBUG (0) debug output\n') def test_level1(self): *************** *** 56,60 **** """) self.assertEquals(self.stream.getvalue(), ! 'Reporter: WARNING [level 2] a warning\n') def test_level3(self): --- 56,60 ---- """) self.assertEquals(self.stream.getvalue(), ! 'Reporter: WARNING (2) a warning\n') def test_level3(self): *************** *** 66,75 **** """) self.assertEquals(self.stream.getvalue(), ! 'Reporter: ERROR [level 3] an error\n') def test_level4(self): self.assertRaises(utils.SystemMessage, self.reporter.system_message, 4, 'a severe error, raises an exception') ! self.assertEquals(self.stream.getvalue(), 'Reporter: SEVERE [level 4] ' 'a severe error, raises an exception\n') --- 66,75 ---- """) self.assertEquals(self.stream.getvalue(), ! 'Reporter: ERROR (3) an error\n') def test_level4(self): self.assertRaises(utils.SystemMessage, self.reporter.system_message, 4, 'a severe error, raises an exception') ! self.assertEquals(self.stream.getvalue(), 'Reporter: SEVERE (4) ' 'a severe error, raises an exception\n') *************** *** 164,168 **** sw = self.reporter.debug('debug output') self.assertEquals(self.stream.getvalue(), ! 'Reporter: DEBUG [level 0] debug output\n') def test_info(self): --- 164,168 ---- sw = self.reporter.debug('debug output') self.assertEquals(self.stream.getvalue(), ! 'Reporter: DEBUG (0) debug output\n') def test_info(self): *************** *** 172,185 **** self.assertEquals( self.stream.getvalue(), ! 'Reporter "lemon.curry": INFO [level 1] some info\n') def test_warning(self): sw = self.reporter.warning('a warning') self.assertEquals(self.stream.getvalue(), ! 'Reporter: WARNING [level 2] a warning\n') sw = self.reporter.warning('a warning', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ ! Reporter: WARNING [level 2] a warning ! Reporter "lemon.curry": WARNING [level 2] a warning """) --- 172,185 ---- self.assertEquals( self.stream.getvalue(), ! 'Reporter "lemon.curry": INFO (1) some info\n') def test_warning(self): sw = self.reporter.warning('a warning') self.assertEquals(self.stream.getvalue(), ! 'Reporter: WARNING (2) a warning\n') sw = self.reporter.warning('a warning', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ ! Reporter: WARNING (2) a warning ! Reporter "lemon.curry": WARNING (2) a warning """) *************** *** 187,196 **** sw = self.reporter.error('an error') self.assertEquals(self.stream.getvalue(), ! 'Reporter: ERROR [level 3] an error\n') self.assertRaises(utils.SystemMessage, self.reporter.error, 'an error', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ ! Reporter: ERROR [level 3] an error ! Reporter "lemon.curry": ERROR [level 3] an error """) --- 187,196 ---- sw = self.reporter.error('an error') self.assertEquals(self.stream.getvalue(), ! 'Reporter: ERROR (3) an error\n') self.assertRaises(utils.SystemMessage, self.reporter.error, 'an error', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ ! Reporter: ERROR (3) an error ! Reporter "lemon.curry": ERROR (3) an error """) *************** *** 199,208 **** 'a severe error') self.assertEquals(self.stream.getvalue(), ! 'Reporter: SEVERE [level 4] a severe error\n') self.assertRaises(utils.SystemMessage, self.reporter.severe, 'a severe error', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ ! Reporter: SEVERE [level 4] a severe error ! Reporter "lemon.curry": SEVERE [level 4] a severe error """) --- 199,208 ---- 'a severe error') self.assertEquals(self.stream.getvalue(), ! 'Reporter: SEVERE (4) a severe error\n') self.assertRaises(utils.SystemMessage, self.reporter.severe, 'a severe error', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ ! Reporter: SEVERE (4) a severe error ! Reporter "lemon.curry": SEVERE (4) a severe error """) |
From: David G. <go...@us...> - 2002-02-20 04:49:35
|
Update of /cvsroot/docstring/dps/dps/writers In directory usw-pr-cvs1:/tmp/cvs-serv20393/dps/dps/writers Added Files: html.py Log Message: Simple HTML writer for HTML 4.0.1 strict.dtd. --- NEW FILE: html.py --- #! /usr/bin/env python """ :Authors: David Goodger :Contact: go...@us... :Revision: $Revision: 1.1 $ :Date: $Date: 2002/02/20 04:49:32 $ :Copyright: This module has been placed in the public domain. Hypertext Markup Language document tree Writer. """ __docformat__ = 'reStructuredText' __all__ = ['Writer'] from dps import writers, nodes, languages class Writer(writers.Writer): output = None """Final translated form of `document`.""" def translate(self): visitor = HTMLTranslator(self.document) self.document.walkabout(visitor) self.output = visitor.astext() def record(self): self.recordfile(self.output, self.destination) class HTMLTranslator(nodes.NodeVisitor): def __init__(self, doctree): nodes.NodeVisitor.__init__(self, doctree) self.language = languages.getlanguage(doctree.languagecode) self.head = ['<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"' ' "http://www.w3.org/TR/html4/strict.dtd">\n', '<HTML LANG="%s">\n<HEAD>\n' % doctree.languagecode, '<LINK REL="StyleSheet" HREF="default.css"' ' TYPE="text/css">'] self.body = ['</HEAD>\n<BODY>\n'] self.foot = ['</BODY>\n</HTML>\n'] self.sectionlevel = 0 def astext(self): return ''.join(self.head + self.body + self.foot) def encode(self, text): """Encode special characters in `text` & return.""" text = text.replace("&", "&") text = text.replace("<", "<") text = text.replace('"', """) text = text.replace(">", ">") return text def starttag(self, node, tagname, **attrs): attlist = attrs.items() for att in ('id', 'class'): if node.has_key(att): attlist.append((att, node[att])) attlist.sort() return '<%s>' % ' '.join([tagname.upper()] + ['%s="%s"' % (n.upper(), self.encode(v)) for n, v in attlist]) def visit_Text(self, node): self.body.append(self.encode(node.astext())) def depart_Text(self, node): pass def visit_abstract(self, node): self.body.append(self.starttag(node, 'div', CLASS='abstract') + '\n<BLOCKQUOTE>\n') self.body.append('<H3>' + self.language.bibliographic_labels['abstract'] + '</H3>\n') def depart_abstract(self, node): self.body.append('</BLOCKQUOTE>\n</DIV>\n') def visit_attention(self, node): pass def depart_attention(self, node): pass def visit_author(self, node): self.head.append(self.starttag(node, 'meta', name='author', content=node.astext()) + '\n') def depart_author(self, node): pass def visit_authors(self, node): pass def depart_authors(self, node): pass def visit_block_quote(self, node): pass def depart_block_quote(self, node): pass def visit_bullet_list(self, node): self.body.append(self.starttag(node, 'ul', CLASS='bullet'+node['bullet']) + '\n') def depart_bullet_list(self, node): self.body.append('</UL>\n') def visit_caption(self, node): pass def depart_caption(self, node): pass def visit_caution(self, node): pass def depart_caution(self, node): pass def visit_classifier(self, node): pass def depart_classifier(self, node): pass def visit_colspec(self, node): pass def depart_colspec(self, node): pass def visit_comment(self, node): self.body.append('<!-- ') def depart_comment(self, node): self.body.append(' -->\n') def visit_contact(self, node): pass def depart_contact(self, node): pass def visit_copyright(self, node): self.head.append(self.starttag(node, 'meta', name='copyright', content=node.astext()) + '\n') def depart_copyright(self, node): pass def visit_danger(self, node): pass def depart_danger(self, node): pass def visit_date(self, node): self.head.append(self.starttag(node, 'meta', name='date', content=node.astext()) + '\n') def depart_date(self, node): pass def visit_definition(self, node): pass def depart_definition(self, node): pass def visit_definition_list(self, node): pass def depart_definition_list(self, node): pass def visit_definition_list_item(self, node): pass def depart_definition_list_item(self, node): pass def visit_description(self, node): pass def depart_description(self, node): pass def visit_docinfo(self, node): # @@@ as a table? pass def depart_docinfo(self, node): pass def visit_doctest_block(self, node): pass def depart_doctest_block(self, node): pass def visit_document(self, node): self.body.append(self.starttag(node, 'div', CLASS='document') + '\n') def depart_document(self, node): self.body.append('</DIV>\n') def visit_emphasis(self, node): self.body.append('<EM>') def depart_emphasis(self, node): self.body.append('</EM>') def visit_entry(self, node): pass def depart_entry(self, node): pass def visit_enumerated_list(self, node): pass def depart_enumerated_list(self, node): pass def visit_error(self, node): pass def depart_error(self, node): pass def visit_field(self, node): pass def depart_field(self, node): pass def visit_field_argument(self, node): pass def depart_field_argument(self, node): pass def visit_field_body(self, node): pass def depart_field_body(self, node): pass def visit_field_list(self, node): pass def depart_field_list(self, node): pass def visit_field_name(self, node): pass def depart_field_name(self, node): pass def visit_figure(self, node): pass def depart_figure(self, node): pass def visit_footnote(self, node): pass def depart_footnote(self, node): pass def visit_footnote_reference(self, node): pass def depart_footnote_reference(self, node): pass def visit_hint(self, node): pass def depart_hint(self, node): pass def visit_image(self, node): pass def depart_image(self, node): pass def visit_important(self, node): pass def depart_important(self, node): pass def visit_interpreted(self, node): self.body.append('<SPAN class="interpreted">') def depart_interpreted(self, node): self.body.append('</SPAN>') def visit_label(self, node): pass def depart_label(self, node): pass def visit_legend(self, node): pass def depart_legend(self, node): pass def visit_list_item(self, node): self.body.append(self.starttag(node, 'li') + '\n') def depart_list_item(self, node): self.body.append('</LI>\n') def visit_literal(self, node): self.body.append('<CODE>') def depart_literal(self, node): self.body.append('</CODE>') def visit_literal_block(self, node): pass def depart_literal_block(self, node): pass def visit_long_option(self, node): pass def depart_long_option(self, node): pass def visit_meta(self, node): self.head.append(self.starttag(node, 'meta', **node.attributes) + '\n') def depart_meta(self, node): pass def visit_note(self, node): pass def depart_note(self, node): pass def visit_option(self, node): pass def depart_option(self, node): pass def visit_option_argument(self, node): pass def depart_option_argument(self, node): pass def visit_option_list(self, node): pass def depart_option_list(self, node): pass def visit_option_list_item(self, node): pass def depart_option_list_item(self, node): pass def visit_organization(self, node): pass def depart_organization(self, node): pass def visit_paragraph(self, node): self.body.append(self.starttag(node, 'p')) def depart_paragraph(self, node): self.body.append('</P>\n') def visit_problematic(self, node): self.body.append('<SPAN class="problematic">') def depart_problematic(self, node): self.body.append('</SPAN>') def visit_reference(self, node): pass def depart_reference(self, node): pass def visit_revision(self, node): pass def depart_revision(self, node): pass def visit_row(self, node): pass def depart_row(self, node): pass def visit_section(self, node): self.sectionlevel += 1 self.body.append(self.starttag(node, 'div', CLASS='section') + '\n') def depart_section(self, node): self.sectionlevel -= 1 self.body.append('</DIV>\n') def visit_short_option(self, node): pass def depart_short_option(self, node): pass def visit_status(self, node): pass def depart_status(self, node): pass def visit_strong(self, node): self.body.append('<STRONG>') def depart_strong(self, node): self.body.append('</STRONG>') def visit_substitution_definition(self, node): pass def depart_substitution_definition(self, node): pass def visit_substitution_reference(self, node): pass def depart_substitution_reference(self, node): pass def visit_subtitle(self, node): self.body.append(self.starttag(node, 'H2', CLASS='subtitle')) def depart_subtitle(self, node): self.body.append('</H1>\n') def visit_system_message(self, node): pass def depart_system_message(self, node): pass def visit_table(self, node): pass def depart_table(self, node): pass def visit_target(self, node): pass def depart_target(self, node): pass def visit_tbody(self, node): pass def depart_tbody(self, node): pass def visit_term(self, node): pass def depart_term(self, node): pass def visit_tgroup(self, node): pass def depart_tgroup(self, node): pass def visit_thead(self, node): pass def depart_thead(self, node): pass def visit_tip(self, node): pass def depart_tip(self, node): pass def visit_title(self, node): if self.sectionlevel == 0: self.head.append('<TITLE>%s</TITLE>\n' % self.encode(node.astext())) self.body.append(self.starttag(node, 'H1', CLASS='title')) else: self.body.append(self.starttag(node, 'H%s' % self.sectionlevel)) # @@@ >H6? def depart_title(self, node): if self.sectionlevel == 0: self.body.append('</H1>\n') else: self.body.append('</H%s>\n' % self.sectionlevel) # @@@ >H6? def visit_transition(self, node): self.body.append('<HR>\n') def depart_transition(self, node): pass def visit_version(self, node): pass def depart_version(self, node): pass def visit_vms_option(self, node): pass def depart_vms_option(self, node): pass def visit_warning(self, node): pass def depart_warning(self, node): pass |
From: David G. <go...@us...> - 2002-02-20 04:48:31
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv20099/dps/test/test_transforms Modified Files: test_doctitle.py Log Message: updated (ids) Index: test_doctitle.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_doctitle.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_doctitle.py 15 Feb 2002 22:45:58 -0000 1.5 --- test_doctitle.py 20 Feb 2002 04:48:28 -0000 1.6 *************** *** 38,42 **** """, """\ ! <document name="title"> <title> Title --- 38,42 ---- """, """\ ! <document id="id1" name="title"> <title> Title *************** *** 52,56 **** """, """\ ! <document name="title"> <title> Title --- 52,56 ---- """, """\ ! <document id="id1" name="title"> <title> Title *************** *** 70,74 **** <paragraph> Paragraph. ! <section name="title"> <title> Title --- 70,74 ---- <paragraph> Paragraph. ! <section id="id1" name="title"> <title> Title *************** *** 86,93 **** """, """\ ! <document name="title"> <title> Title ! <subtitle name="subtitle"> Subtitle <paragraph> --- 86,93 ---- """, """\ ! <document id="id1" name="title"> <title> Title ! <subtitle id="id2" name="subtitle"> Subtitle <paragraph> *************** *** 101,105 **** """, """\ ! <document name="title"> <title> Title --- 101,105 ---- """, """\ ! <document id="id1" name="title"> <title> Title *************** *** 120,124 **** """, """\ ! <document name="long title"> <title> Long Title --- 120,124 ---- """, """\ ! <document id="id1" name="long title"> <title> Long Title *************** *** 147,151 **** """, """\ ! <document name="title 1"> <title> Title 1 --- 147,151 ---- """, """\ ! <document id="id1" name="title 1"> <title> Title 1 *************** *** 154,163 **** <paragraph> Paragraph 1. ! <section name="title 2"> <title> Title 2 <paragraph> Paragraph 2. ! <section name="title 3"> <title> Title 3 --- 154,163 ---- <paragraph> Paragraph 1. ! <section id="id2" name="title 2"> <title> Title 2 <paragraph> Paragraph 2. ! <section id="id3" name="title 3"> <title> Title 3 |
From: David G. <go...@us...> - 2002-02-20 04:46:00
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv19501/dps/test/test_transforms Modified Files: test_docinfo.py Log Message: updated Index: test_docinfo.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_docinfo.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_docinfo.py 15 Feb 2002 22:45:58 -0000 1.5 --- test_docinfo.py 20 Feb 2002 04:45:57 -0000 1.6 *************** *** 321,324 **** --- 321,325 ---- ]) + if __name__ == '__main__': import unittest |
From: David G. <go...@us...> - 2002-02-20 04:42:17
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv18872/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.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** dps-notes.txt 15 Feb 2002 22:55:08 -0000 1.26 --- dps-notes.txt 20 Feb 2002 04:42:14 -0000 1.27 *************** *** 92,96 **** - Perhaps keep a name->id mapping file? This could be stored permanently, read by subsequent processing runs, and updated with ! new entries. - Considerations for an HTML Writer [#]_: --- 92,96 ---- - Perhaps keep a name->id mapping file? This could be stored permanently, read by subsequent processing runs, and updated with ! new entries. ("Persistent ID mapping"?) - Considerations for an HTML Writer [#]_: |
From: David G. <go...@us...> - 2002-02-20 04:30:05
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv16650/dps/test/test_transforms Modified Files: test_hyperlinks.py Log Message: updated (ids) Index: test_hyperlinks.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_hyperlinks.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_hyperlinks.py 15 Feb 2002 22:45:58 -0000 1.4 --- test_hyperlinks.py 20 Feb 2002 04:30:03 -0000 1.5 *************** *** 42,46 **** direct external ! <target name="direct" refuri="http://direct"> """], ["""\ --- 42,46 ---- direct external ! <target id="id1" name="direct" refuri="http://direct"> """], ["""\ *************** *** 56,61 **** indirect external ! <target name="indirect" refuri="http://indirect"> ! <target name="xtarget" refuri="http://indirect"> """], ["""\ --- 56,61 ---- indirect external ! <target id="id1" name="indirect" refuri="http://indirect"> ! <target id="id2" name="xtarget" refuri="http://indirect"> """], ["""\ *************** *** 66,70 **** """\ <document> ! <target name="direct"> <paragraph> <reference refname="direct"> --- 66,70 ---- """\ <document> ! <target id="id1" name="direct"> <paragraph> <reference refname="direct"> *************** *** 82,92 **** """\ <document> ! <target name="ztarget"> <paragraph> <reference refname="ztarget"> indirect internal ! <target name="indirect2" refname="ztarget"> ! <target name="indirect" refname="ztarget"> """], ["""\ --- 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"> """], ["""\ *************** *** 100,104 **** <reference refuri="http://direct"> direct external ! <target name="_:1:_" refuri="http://direct"> """], ["""\ --- 100,104 ---- <reference refuri="http://direct"> direct external ! <target id="id1" name="_:1:_" refuri="http://direct"> """], ["""\ *************** *** 113,118 **** <reference refuri="http://indirect"> indirect external ! <target name="_:1:_" refuri="http://indirect"> ! <target name="xtarget" refuri="http://indirect"> """], ["""\ --- 113,118 ---- <reference refuri="http://indirect"> indirect external ! <target id="id2" name="_:1:_" refuri="http://indirect"> ! <target id="id1" name="xtarget" refuri="http://indirect"> """], ["""\ *************** *** 123,127 **** """\ <document> ! <target name="_:1:_"> <paragraph> <reference refname="_:1:_"> --- 123,127 ---- """\ <document> ! <target id="id1" name="_:1:_"> <paragraph> <reference refname="_:1:_"> *************** *** 137,145 **** """\ <document> ! <target name="ztarget"> <paragraph> <reference refname="ztarget"> indirect internal ! <target name="_:1:_" refname="ztarget"> """], ]) --- 137,145 ---- """\ <document> ! <target id="id1" name="ztarget"> <paragraph> <reference refname="ztarget"> indirect internal ! <target id="id2" name="_:1:_" refname="ztarget"> """], ]) *************** *** 155,159 **** """\ <document> ! <target name="internal hyperlink"> <paragraph> This paragraph referenced. --- 155,159 ---- """\ <document> ! <target id="id1" name="internal hyperlink"> <paragraph> This paragraph referenced. *************** *** 177,182 **** """\ <document> ! <target name="chained"> ! <target name="internal hyperlink"> <paragraph> This paragraph referenced. --- 177,182 ---- """\ <document> ! <target id="id1" name="chained"> ! <target id="id2" name="internal hyperlink"> <paragraph> This paragraph referenced. *************** *** 200,204 **** """\ <document> ! <target name="external hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> --- 200,204 ---- """\ <document> ! <target id="id1" name="external hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> *************** *** 212,217 **** """\ <document> ! <target name="external hyperlink" refuri="http://uri"> ! <target name="indirect target" refuri="http://uri"> <system_message level="1" type="INFO"> <paragraph> --- 212,217 ---- """\ <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> *************** *** 227,232 **** """\ <document> ! <target name="chained" refuri="http://uri"> ! <target name="external hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> --- 227,232 ---- """\ <document> ! <target id="id1" name="chained" refuri="http://uri"> ! <target id="id2" name="external hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> *************** *** 246,251 **** """\ <document> ! <target name="external hyperlink" refuri="http://uri"> ! <target name="indirect hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> --- 246,251 ---- """\ <document> ! <target id="id1" name="external hyperlink" refuri="http://uri"> ! <target id="id2" name="indirect hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> *************** *** 262,268 **** """\ <document> ! <target name="external hyperlink" refuri="http://uri"> ! <target name="chained" refuri="http://uri"> ! <target name="indirect hyperlink" refuri="http://uri"> <paragraph> <reference refuri="http://uri"> --- 262,268 ---- """\ <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"> *************** *** 289,298 **** """\ <document> ! <target name="_:1:_" refuri="http://full"> ! <target name="_:2:_" refuri="http://simplified"> ! <target name="_:3:_" refuri="http://simplified"> ! <target name="external" refuri="http://indirect.external"> ! <target name="_:4:_" refuri="http://indirect.external"> ! <target name="_:5:_"> <paragraph> <reference refuri="http://full"> --- 289,298 ---- """\ <document> ! <target id="id2" name="_:1:_" refuri="http://full"> ! <target id="id3" name="_:2:_" refuri="http://simplified"> ! <target id="id4" name="_:3:_" refuri="http://simplified"> ! <target id="id1" name="external" refuri="http://indirect.external"> ! <target id="id5" name="_:4:_" refuri="http://indirect.external"> ! <target id="id6" name="_:5:_"> <paragraph> <reference refuri="http://full"> *************** *** 326,334 **** target 's (different URIs): ! <target dupname="target" refuri="first"> <system_message level="2" type="WARNING"> <paragraph> Duplicate explicit target name: "target" ! <target dupname="target" refuri="second"> """], ]) --- 326,334 ---- target 's (different URIs): ! <target dupname="target" id="id1" refuri="first"> <system_message level="2" type="WARNING"> <paragraph> Duplicate explicit target name: "target" ! <target dupname="target" id="id2" refuri="second"> """], ]) |
From: David G. <go...@us...> - 2002-02-20 04:29:57
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv16614/dps/test/test_transforms Modified Files: test_footnotes.py Log Message: updated (ids) Index: test_footnotes.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_footnotes.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_footnotes.py 15 Feb 2002 22:45:58 -0000 1.5 --- test_footnotes.py 20 Feb 2002 04:29:54 -0000 1.6 *************** *** 39,43 **** <footnote_reference refname="label"> label ! <footnote name="label"> <label> label --- 39,43 ---- <footnote_reference refname="label"> label ! <footnote id="id1" name="label"> <label> label *************** *** 55,59 **** <footnote_reference auto="1" refname="autolabel"> 1 ! <footnote auto="1" name="autolabel"> <label> 1 --- 55,59 ---- <footnote_reference auto="1" refname="autolabel"> 1 ! <footnote auto="1" id="id1" name="autolabel"> <label> 1 *************** *** 72,76 **** <footnote_reference auto="1" refname="1"> 1 ! <footnote auto="1" name="1"> <label> 1 --- 72,76 ---- <footnote_reference auto="1" refname="1"> 1 ! <footnote auto="1" id="id1" name="1"> <label> 1 *************** *** 97,111 **** 2 is the second auto-numbered footnote reference. ! <footnote auto="1" name="1"> <label> 1 <paragraph> Auto-numbered footnote 1. ! <footnote auto="1" name="2"> <label> 2 <paragraph> Auto-numbered footnote 2. ! <footnote auto="1" name="3"> <label> 3 --- 97,111 ---- 2 is the second auto-numbered footnote reference. ! <footnote auto="1" id="id1" name="1"> <label> 1 <paragraph> Auto-numbered footnote 1. ! <footnote auto="1" id="id2" name="2"> <label> 2 <paragraph> Auto-numbered footnote 2. ! <footnote auto="1" id="id3" name="3"> <label> 3 *************** *** 137,151 **** 3 is a reference to the third auto-numbered footnote. ! <footnote auto="1" name="first"> <label> 1 <paragraph> First auto-numbered footnote. ! <footnote auto="1" name="second"> <label> 2 <paragraph> Second auto-numbered footnote. ! <footnote auto="1" name="third"> <label> 3 --- 137,151 ---- 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 *************** *** 210,239 **** <footnote_reference auto="1" refname="six"> doesn't exist. ! <footnote auto="1" name="1"> <label> 1 <paragraph> Auto-numbered footnote 1. ! <footnote auto="1" name="two"> <label> 2 <paragraph> Auto-numbered footnote 2. ! <footnote auto="1" name="3"> <label> 3 <paragraph> Auto-numbered footnote 3. ! <footnote auto="1" name="four"> <label> 4 <paragraph> Auto-numbered footnote 4. ! <footnote auto="1" dupname="five"> <label> 5 <paragraph> Auto-numbered footnote 5. ! <footnote auto="1" dupname="five"> <label> 6 --- 210,239 ---- <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 *************** *** 258,267 **** <paragraph> Mixed auto-numbered and manual footnotes: ! <footnote dupname="1"> <label> 1 <paragraph> manually numbered ! <footnote auto="1" dupname="1"> <label> 1 --- 258,267 ---- <paragraph> Mixed auto-numbered and manual footnotes: ! <footnote dupname="1" id="id1"> <label> 1 <paragraph> manually numbered ! <footnote auto="1" dupname="1" id="id3"> <label> 1 *************** *** 271,275 **** <paragraph> Duplicate explicit target name: "1" ! <footnote auto="1" name="label"> <label> 2 --- 271,275 ---- <paragraph> Duplicate explicit target name: "1" ! <footnote auto="1" id="id2" name="label"> <label> 2 *************** *** 299,308 **** 1 . ! <footnote auto="1" name="1"> <label> 1 <paragraph> Unlabeled autonumbered footnote. ! <footnote auto="1" name="footnote"> <label> 2 --- 299,308 ---- 1 . ! <footnote auto="1" id="id2" name="1"> <label> 1 <paragraph> Unlabeled autonumbered footnote. ! <footnote auto="1" id="id1" name="footnote"> <label> 2 |
From: David G. <go...@us...> - 2002-02-20 04:18:27
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv14863/dps Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** HISTORY.txt 15 Feb 2002 22:54:35 -0000 1.39 --- HISTORY.txt 20 Feb 2002 04:18:25 -0000 1.40 *************** *** 89,92 **** --- 89,93 ---- - Simplified target record keeping. - Changed "system_warning" to "system_message". + - Added 'id' attribute support to ``document``. * dps/roman.py: Added to project. Written by and courtesy of Mark *************** *** 182,186 **** - Fixed typos & omissions; now validates. ! - Added 'source' to basic.atts; removed 'rawtext'. - Changed field_argument's model to PCDATA. - Added option_list and doctest_block from ppdi.dtd. --- 183,188 ---- - Fixed typos & omissions; now validates. ! - Added 'source' to %basic.atts, removed 'rawtext'. ! - Added 'class' to %basic.atts for style sheets. - Changed field_argument's model to PCDATA. - Added option_list and doctest_block from ppdi.dtd. |
From: David G. <go...@us...> - 2002-02-20 04:17:38
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv14709/dps/dps Modified Files: nodes.py Log Message: - Added flow controls to ``Node.walk()`` & ``Node.walkabout()``. - Added 'id' attribute support to ``document``. Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** nodes.py 15 Feb 2002 22:42:44 -0000 1.29 --- nodes.py 20 Feb 2002 04:17:36 -0000 1.30 *************** *** 56,63 **** method = getattr(visitor, 'visit_' + self.__class__.__name__, visitor.unknown_visit) ! method(self) ! children = self.getchildren() ! for i in range(len(children)): ! children[i].walk(visitor) def walkabout(self, visitor): --- 56,69 ---- method = getattr(visitor, 'visit_' + self.__class__.__name__, visitor.unknown_visit) ! try: ! method(self) ! children = self.getchildren() ! try: ! for i in range(len(children)): ! children[i].walk(visitor) ! except SkipSiblings: ! pass ! except (SkipChildren, SkipDeparture): ! pass def walkabout(self, visitor): *************** *** 73,80 **** method = getattr(visitor, 'visit_' + self.__class__.__name__, visitor.unknown_visit) ! method(self) ! children = self.getchildren() ! for i in range(len(children)): ! children[i].walkabout(visitor) method = getattr(visitor, 'depart_' + self.__class__.__name__, visitor.unknown_departure) --- 79,94 ---- method = getattr(visitor, 'visit_' + self.__class__.__name__, visitor.unknown_visit) ! try: ! method(self) ! children = self.getchildren() ! try: ! for i in range(len(children)): ! children[i].walkabout(visitor) ! except SkipSiblings: ! pass ! except SkipChildren: ! pass ! except SkipDeparture: ! return method = getattr(visitor, 'depart_' + self.__class__.__name__, visitor.unknown_departure) *************** *** 489,492 **** --- 503,512 ---- """Mapping of reference names to lists of reference nodes.""" + self.nameids = {} + """Mapping of names to unique id's.""" + + self.ids = {} + """Mapping of ids to nodes.""" + self.substitution_refs = {} """Mapping of substitution names to lists of substitution_reference *************** *** 514,517 **** --- 534,540 ---- """Initial auto-numbered footnote number.""" + self.id_start = 1 + """Initial ID number.""" + def asdom(self, dom=xml.dom.minidom): domroot = dom.Document() *************** *** 519,525 **** return domroot ! def note_implicit_target(self, targetnode, innode=None): if innode == None: innode = self name = targetnode['name'] if self.explicit_targets.has_key(name) \ --- 542,572 ---- return domroot ! def set_id(self, node, innode=None): if innode == None: innode = self + if node.has_key('id'): + id = node['id'] + if self.ids.has_key(id) and self.ids[id] is not node: + msg = self.reporter.error('Duplicate ID: "%s"' % id) + innode += msg + else: + while 1: + id = 'id%s' % self.id_start + self.id_start += 1 + if not self.ids.has_key(id): + break + node['id'] = id + self.ids[id] = node + 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)) + innode += msg + self.nameids[name] = id + + def note_implicit_target(self, targetnode, innode=None): name = targetnode['name'] if self.explicit_targets.has_key(name) \ *************** *** 528,531 **** --- 575,580 ---- sw = self.reporter.info( 'Duplicate implicit target name: "%s"' % name) + if innode == None: + innode = self innode += sw self.clear_target_names(name, self.implicit_targets) *************** *** 533,536 **** --- 582,586 ---- targetnode['dupname'] = name self.implicit_targets[name] = targetnode + self.set_id(targetnode) def note_explicit_target(self, targetnode, innode=None): *************** *** 560,563 **** --- 610,614 ---- self.clear_target_names(name, self.implicit_targets) self.explicit_targets[name] = targetnode + self.set_id(targetnode) def clear_target_names(self, name, *targetdicts): *************** *** 597,606 **** def note_substitution_def(self, substitutiondefnode, innode=None): - if innode == None: - innode = self name = substitutiondefnode['name'] if self.substitution_defs.has_key(name): sw = self.reporter.error( 'Duplicate substitution definition name: "%s"' % name) innode += sw oldnode = self.substitution_defs[name] --- 648,657 ---- def note_substitution_def(self, substitutiondefnode, innode=None): name = substitutiondefnode['name'] if self.substitution_defs.has_key(name): sw = self.reporter.error( 'Duplicate substitution definition name: "%s"' % name) + if innode == None: + innode = self innode += sw oldnode = self.substitution_defs[name] *************** *** 838,839 **** --- 889,896 ---- self.default_departure(node)\n""" % name del name + + + class VisitorException(Exception): pass + class SkipChildren(VisitorException): pass + class SkipSiblings(VisitorException): pass + class SkipDeparture(VisitorException): pass |
From: David G. <go...@us...> - 2002-02-20 04:14:54
|
Update of /cvsroot/docstring/dps/dps/writers In directory usw-pr-cvs1:/tmp/cvs-serv14209/dps/dps/writers Modified Files: __init__.py Log Message: language module support (may drop) Index: __init__.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/writers/__init__.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** __init__.py 12 Feb 2002 02:13:38 -0000 1.3 --- __init__.py 20 Feb 2002 04:14:52 -0000 1.4 *************** *** 16,19 **** --- 16,20 ---- + from dps import languages import sys *************** *** 30,33 **** --- 31,37 ---- """The document to write.""" + language = None + """Language module for the document.""" + destination = None """Where to write the document.""" *************** *** 45,48 **** --- 49,53 ---- def write(self, document, destination): self.document = document + self.language = languages.getlanguage(document.languagecode) self.destination = destination self.transform() |
From: David G. <go...@us...> - 2002-02-20 04:14:18
|
Update of /cvsroot/docstring/dps/dps/transforms In directory usw-pr-cvs1:/tmp/cvs-serv14000/dps/dps/transforms Modified Files: references.py Log Message: updated docs & fixed ChainedTargetResolver visitor. Index: references.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/transforms/references.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** references.py 6 Feb 2002 02:50:31 -0000 1.5 --- references.py 20 Feb 2002 04:14:15 -0000 1.6 *************** *** 41,56 **** <reference refname="_:1:_"> text ! <target name="_:1:_"> 2. Chained targets:: ! <target name="chained"> ! <target name="external hyperlink" refuri="http://uri"> Attributes "refuri" and "refname" are migrated from the final concrete target up the chain of contiguous adjacent internal targets:: ! <target name="chained" refuri="http://uri"> ! <target name="external hyperlink" refuri="http://uri"> 3. a) Indirect targets:: --- 41,56 ---- <reference refname="_:1:_"> text ! <target id="id1" name="_:1:_"> 2. Chained targets:: ! <target id="id1" name="chained"> ! <target id="id2" name="external hyperlink" refuri="http://uri"> Attributes "refuri" and "refname" are migrated from the final concrete target up the chain of contiguous adjacent internal targets:: ! <target id="id1" name="chained" refuri="http://uri"> ! <target id="id2" name="external hyperlink" refuri="http://uri"> 3. a) Indirect targets:: *************** *** 59,64 **** <reference refname="indirect external"> indirect external ! <target name="direct external" refuri="http://indirect"> ! <target name="indirect external" refname="direct external"> Attributes "refuri" and "refname" are migrated back to all indirect --- 59,66 ---- <reference refname="indirect external"> indirect external ! <target id="id1" name="direct external" ! refuri="http://indirect"> ! <target id="id2" name="indirect external" ! refname="direct external"> Attributes "refuri" and "refname" are migrated back to all indirect *************** *** 69,74 **** <reference refname="indirect external"> indirect external ! <target name="direct external" refuri="http://indirect"> ! <target name="indirect external" refuri="http://indirect"> If the "refuri" attribute is migrated, the preexisting "refname" --- 71,78 ---- <reference refname="indirect external"> indirect external ! <target id="id1" name="direct external" ! refuri="http://indirect"> ! <target id="id2" name="indirect external" ! refuri="http://indirect"> If the "refuri" attribute is migrated, the preexisting "refname" *************** *** 78,87 **** b) Indirect internal references:: ! <target name="final target"> <paragraph> <reference refname="indirect internal"> indirect internal ! <target name="indirect internal 2" refname="final target"> ! <target name="indirect internal" refname="indirect internal 2"> Targets which indirectly refer to an internal target become one-hop --- 82,93 ---- b) Indirect internal references:: ! <target id="id1" name="final target"> <paragraph> <reference refname="indirect internal"> indirect internal ! <target id="id2" name="indirect internal 2" ! refname="final target"> ! <target id="id3" name="indirect internal" ! refname="indirect internal 2"> Targets which indirectly refer to an internal target become one-hop *************** *** 90,99 **** internal target become direct internal references:: ! <target name="final target"> <paragraph> <reference refname="final target"> indirect internal ! <target name="indirect internal 2" refname="final target"> ! <target name="indirect internal" refname="final target"> 4. External references:: --- 96,107 ---- internal target become direct internal references:: ! <target id="id1" name="final target"> <paragraph> <reference refname="final target"> indirect internal ! <target id="id2" name="indirect internal 2" ! refname="final target"> ! <target id="id3" name="indirect internal" ! refname="final target"> 4. External references:: *************** *** 102,106 **** <reference refname="direct external"> direct external ! <target name="direct external" refuri="http://direct"> The "refname" attribute is replaced by the direct "refuri" attribute:: --- 110,114 ---- <reference refname="direct external"> direct external ! <target id="id1" name="direct external" refuri="http://direct"> The "refname" attribute is replaced by the direct "refuri" attribute:: *************** *** 109,113 **** <reference refuri="http://direct"> direct external ! <target name="direct external" refuri="http://direct"> """ --- 117,121 ---- <reference refuri="http://direct"> direct external ! <target id="id1" name="direct external" refuri="http://direct"> """ *************** *** 266,269 **** --- 274,280 ---- <target name="g" refname="d"> """ + + def unknown_visit(self, node): + pass def visit_target(self, node): |
From: David G. <go...@us...> - 2002-02-20 04:10:32
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv13188/dps/spec Modified Files: gpdi.dtd Log Message: - Added 'class' to %basic.atts for style sheets. Index: gpdi.dtd =================================================================== RCS file: /cvsroot/docstring/dps/spec/gpdi.dtd,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** gpdi.dtd 15 Feb 2002 22:53:17 -0000 1.31 --- gpdi.dtd 20 Feb 2002 04:10:29 -0000 1.32 *************** *** 47,50 **** --- 47,51 ---- - `dupname` is the same as `name`, used when it's a duplicate. - `source` is the name of the source of this document or fragment. + - `class` is used to transmit individuality information forward. --> <!ENTITY % basic.atts *************** *** 53,56 **** --- 54,58 ---- dupname CDATA #IMPLIED source CDATA #IMPLIED + class CDATA #IMPLIED %additional.basic.atts; "> |
From: David G. <go...@us...> - 2002-02-15 22:55:12
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv29118 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.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** dps-notes.txt 13 Feb 2002 02:25:29 -0000 1.25 --- dps-notes.txt 15 Feb 2002 22:55:08 -0000 1.26 *************** *** 75,78 **** --- 75,111 ---- dps/readers. Potential nastiness.) + - Add "name" -> "id" attribute conversion. We must have unique, + 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? + + - 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 + permanently, read by subsequent processing runs, and updated with + new entries. + + - Considerations for an HTML Writer [#]_: + + - Boolean attributes. ``<element boolean>`` is good, ``<element + boolean="boolean">`` is bad. Use a special value in attributes + mapping, such as ``None``? + + - Escape double-dashes inside comments. + + - Put the language code into an appropriate element's LANG + attribute (<HTML>?). + + .. [#] Source: `HTML 4.0 in Netscape and Explorer`__. + __ http://www.webreference.com/dev/html4nsie/index.html + Coding Conventions |
From: David G. <go...@us...> - 2002-02-15 22:54:39
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv28947 Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** HISTORY.txt 13 Feb 2002 02:29:39 -0000 1.38 --- HISTORY.txt 15 Feb 2002 22:54:35 -0000 1.39 *************** *** 88,91 **** --- 88,92 ---- - Added ``Element.index()`` and ``Element.replace()`` methods. - Simplified target record keeping. + - Changed "system_warning" to "system_message". * dps/roman.py: Added to project. Written by and courtesy of Mark *************** *** 116,119 **** --- 117,121 ---- Reporter. - Removed Reporter.strong_system_warning (not needed). + - Changed "system_warning" to "system_message". - Improved error stream handling. - Reworked ``Reporter`` based on "log4j". *************** *** 213,216 **** --- 215,219 ---- - Added 'problematic', inline relative of 'system_warning'. - Added 'type' attribute to 'system_warning', removed 'warning'. + - Changed "system_warning" to "system_message". * spec/pdpi.dtd: |
From: David G. <go...@us...> - 2002-02-15 22:53:20
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv28623 Modified Files: pep-0258.txt gpdi.dtd Log Message: - Changed "system_warning" to "system_message". Index: pep-0258.txt =================================================================== RCS file: /cvsroot/docstring/dps/spec/pep-0258.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0258.txt 7 Feb 2002 01:56:41 -0000 1.5 --- pep-0258.txt 15 Feb 2002 22:53:17 -0000 1.6 *************** *** 349,361 **** When the parser encounters an error in markup, it inserts a system ! warning (DTD element 'system_warning'). There are five levels of ! system warnings: - Level-0, "DEBUG": an internal reporting issue. There is no ! effect on the processing. Level-0 system warnings are handled separately from the others. - Level-1, "INFO": a minor issue that can be ignored. There is no ! effect on the processing. Typically level-1 system warnings are not reported. --- 349,361 ---- When the parser encounters an error in markup, it inserts a system ! message (DTD element 'system_message). There are five levels of ! system messages: - Level-0, "DEBUG": an internal reporting issue. There is no ! effect on the processing. Level-0 system messages are handled separately from the others. - Level-1, "INFO": a minor issue that can be ignored. There is no ! effect on the processing. Typically level-1 system messages are not reported. *************** *** 367,375 **** - Level-4, "SEVERE": a severe error that must be addressed. ! Typically level-4 system warnings are turned into exceptions which halt processing. If ignored, the output will contain severe errors. ! Although the initial warning levels were devised independently, they have a strong correspondence to VMS error condition severity levels [9]; the names in quotes for levels 1 through 4 were --- 367,375 ---- - Level-4, "SEVERE": a severe error that must be addressed. ! Typically level-4 system messages are turned into exceptions which halt processing. If ignored, the output will contain severe errors. ! Although the initial message levels were devised independently, they have a strong correspondence to VMS error condition severity levels [9]; the names in quotes for levels 1 through 4 were Index: gpdi.dtd =================================================================== RCS file: /cvsroot/docstring/dps/spec/gpdi.dtd,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** gpdi.dtd 6 Feb 2002 03:06:03 -0000 1.30 --- gpdi.dtd 15 Feb 2002 22:53:17 -0000 1.31 *************** *** 114,118 **** | note | tip | hint | warning | error | caution | danger | important ! | target | substitution_definition | comment | system_warning %additional.body.elements; "> --- 114,118 ---- | note | tip | hint | warning | error | caution | danger | important ! | target | substitution_definition | comment | system_message %additional.body.elements; "> *************** *** 405,411 **** %calstblx; ! <!-- Used by the processing system to record a warning. --> ! <!ELEMENT system_warning (%body.elements;)+> ! <!ATTLIST system_warning %basic.atts; level NMTOKEN #IMPLIED --- 405,411 ---- %calstblx; ! <!-- Used to record processing information. --> ! <!ELEMENT system_message (%body.elements;)+> ! <!ATTLIST system_message %basic.atts; level NMTOKEN #IMPLIED |
From: David G. <go...@us...> - 2002-02-15 22:46:03
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv27018 Modified Files: test_footnotes.py test_hyperlinks.py test_substitutions.py test_doctitle.py test_docinfo.py Log Message: - Changed "system_warning" to "system_message". Index: test_footnotes.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_footnotes.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_footnotes.py 6 Feb 2002 03:11:01 -0000 1.4 --- test_footnotes.py 15 Feb 2002 22:45:58 -0000 1.5 *************** *** 238,247 **** <label> 6 ! <system_warning level="2" type="WARNING"> <paragraph> Duplicate explicit target name: "five" <paragraph> Auto-numbered footnote 5 again (duplicate). ! <system_warning level="3" type="ERROR"> <paragraph> Too many autonumbered footnote references: only 2 corresponding footnotes available. --- 238,247 ---- <label> 6 ! <system_message level="2" type="WARNING"> <paragraph> Duplicate explicit target name: "five" <paragraph> Auto-numbered footnote 5 again (duplicate). ! <system_message level="3" type="ERROR"> <paragraph> Too many autonumbered footnote references: only 2 corresponding footnotes available. *************** *** 268,272 **** <paragraph> auto-numbered ! <system_warning level="2" type="WARNING"> <paragraph> Duplicate explicit target name: "1" --- 268,272 ---- <paragraph> auto-numbered ! <system_message level="2" type="WARNING"> <paragraph> Duplicate explicit target name: "1" Index: test_hyperlinks.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_hyperlinks.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_hyperlinks.py 6 Feb 2002 03:11:14 -0000 1.3 --- test_hyperlinks.py 15 Feb 2002 22:45:58 -0000 1.4 *************** *** 214,218 **** <target name="external hyperlink" refuri="http://uri"> <target name="indirect target" refuri="http://uri"> ! <system_warning level="1" type="INFO"> <paragraph> External hyperlink target "indirect target" is not referenced. --- 214,218 ---- <target name="external hyperlink" refuri="http://uri"> <target name="indirect target" refuri="http://uri"> ! <system_message level="1" type="INFO"> <paragraph> External hyperlink target "indirect target" is not referenced. *************** *** 327,331 **** 's (different URIs): <target dupname="target" refuri="first"> ! <system_warning level="2" type="WARNING"> <paragraph> Duplicate explicit target name: "target" --- 327,331 ---- 's (different URIs): <target dupname="target" refuri="first"> ! <system_message level="2" type="WARNING"> <paragraph> Duplicate explicit target name: "target" Index: test_substitutions.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_substitutions.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_substitutions.py 6 Feb 2002 03:11:25 -0000 1.3 --- test_substitutions.py 15 Feb 2002 22:45:58 -0000 1.4 *************** *** 53,57 **** unknown substitution. ! <system_warning level="3" type="ERROR"> <paragraph> Undefined substitution referenced: "unknown". --- 53,57 ---- unknown substitution. ! <system_message level="3" type="ERROR"> <paragraph> Undefined substitution referenced: "unknown". Index: test_doctitle.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_doctitle.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_doctitle.py 12 Feb 2002 02:11:00 -0000 1.4 --- test_doctitle.py 15 Feb 2002 22:45:58 -0000 1.5 *************** *** 104,108 **** <title> Title ! <system_warning level="1" type="INFO"> <paragraph> Title underline too short at line 2. --- 104,108 ---- <title> Title ! <system_message level="1" type="INFO"> <paragraph> Title underline too short at line 2. *************** *** 116,120 **** Test long title and space normalization. ! The system_warning should move after the document title (it was before the beginning of the section). """, --- 116,120 ---- Test long title and space normalization. ! The system_message should move after the document title (it was before the beginning of the section). """, *************** *** 123,132 **** <title> Long Title ! <system_warning level="1" type="INFO"> <paragraph> Title overline too short at line 1. <paragraph> Test long title and space normalization. ! The system_warning should move after the document title (it was before the beginning of the section). """], --- 123,132 ---- <title> Long Title ! <system_message level="1" type="INFO"> <paragraph> Title overline too short at line 1. <paragraph> Test long title and space normalization. ! The system_message should move after the document title (it was before the beginning of the section). """], Index: test_docinfo.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_transforms/test_docinfo.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_docinfo.py 6 Feb 2002 03:10:38 -0000 1.4 --- test_docinfo.py 15 Feb 2002 22:45:58 -0000 1.5 *************** *** 103,107 **** <paragraph> Abstract 2 (should generate a warning). ! <system_warning level="2" type="WARNING"> <paragraph> There can only be one abstract. --- 103,107 ---- <paragraph> Abstract 2 (should generate a warning). ! <system_message level="2" type="WARNING"> <paragraph> There can only be one abstract. *************** *** 142,146 **** <paragraph> must be a paragraph ! <system_warning level="2" type="WARNING"> <paragraph> Cannot extract bibliographic field "Author" containing anything other than a single paragraph. --- 142,146 ---- <paragraph> must be a paragraph ! <system_message level="2" type="WARNING"> <paragraph> Cannot extract bibliographic field "Author" containing anything other than a single paragraph. *************** *** 153,157 **** <paragraph> paragraph. ! <system_warning level="2" type="WARNING"> <paragraph> Cannot extract compound bibliographic field "Date". --- 153,157 ---- <paragraph> paragraph. ! <system_message level="2" type="WARNING"> <paragraph> Cannot extract compound bibliographic field "Date". *************** *** 160,164 **** Version <field_body> ! <system_warning level="2" type="WARNING"> <paragraph> Cannot extract empty bibliographic field "Version". --- 160,164 ---- Version <field_body> ! <system_message level="2" type="WARNING"> <paragraph> Cannot extract empty bibliographic field "Version". *************** *** 239,243 **** Authors <field_body> ! <system_warning level="2" type="WARNING"> <paragraph> Cannot extract empty bibliographic field "Authors". --- 239,243 ---- Authors <field_body> ! <system_message level="2" type="WARNING"> <paragraph> Cannot extract empty bibliographic field "Authors". *************** *** 253,257 **** <paragraph> Two ! <system_warning level="2" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. --- 253,257 ---- <paragraph> Two ! <system_message level="2" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. *************** *** 263,267 **** <list_item> <list_item> ! <system_warning level="2" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. --- 263,267 ---- <list_item> <list_item> ! <system_message level="2" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. *************** *** 276,280 **** <paragraph> Two ! <system_warning level="2" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. --- 276,280 ---- <paragraph> Two ! <system_message level="2" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. *************** *** 289,293 **** <paragraph> Two ! <system_warning level="2" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. --- 289,293 ---- <paragraph> Two ! <system_message level="2" type="WARNING"> <paragraph> Bibliographic field "Authors" incompatible with extraction: it must contain either a single paragraph (with authors separated by one of ";,"), multiple paragraphs (one per author), or a bullet list with one paragraph (one author) per item. |
From: David G. <go...@us...> - 2002-02-15 22:45:36
|
Update of /cvsroot/docstring/dps/test In directory usw-pr-cvs1:/tmp/cvs-serv26860 Modified Files: test_utils.py Log Message: - Changed "system_warning" to "system_message". Index: test_utils.py =================================================================== RCS file: /cvsroot/docstring/dps/test/test_utils.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_utils.py 6 Feb 2002 03:11:35 -0000 1.3 --- test_utils.py 15 Feb 2002 22:45:30 -0000 1.4 *************** *** 30,36 **** def test_level0(self): ! sw = self.reporter.system_warning(0, 'debug output') self.assertEquals(sw.pformat(), """\ ! <system_warning level="0" type="DEBUG"> <paragraph> debug output --- 30,36 ---- def test_level0(self): ! sw = self.reporter.system_message(0, 'debug output') self.assertEquals(sw.pformat(), """\ ! <system_message level="0" type="DEBUG"> <paragraph> debug output *************** *** 40,46 **** def test_level1(self): ! sw = self.reporter.system_warning(1, 'a little reminder') self.assertEquals(sw.pformat(), """\ ! <system_warning level="1" type="INFO"> <paragraph> a little reminder --- 40,46 ---- def test_level1(self): ! sw = self.reporter.system_message(1, 'a little reminder') self.assertEquals(sw.pformat(), """\ ! <system_message level="1" type="INFO"> <paragraph> a little reminder *************** *** 49,55 **** def test_level2(self): ! sw = self.reporter.system_warning(2, 'a warning') self.assertEquals(sw.pformat(), """\ ! <system_warning level="2" type="WARNING"> <paragraph> a warning --- 49,55 ---- def test_level2(self): ! sw = self.reporter.system_message(2, 'a warning') self.assertEquals(sw.pformat(), """\ ! <system_message level="2" type="WARNING"> <paragraph> a warning *************** *** 59,65 **** def test_level3(self): ! sw = self.reporter.system_warning(3, 'an error') self.assertEquals(sw.pformat(), """\ ! <system_warning level="3" type="ERROR"> <paragraph> an error --- 59,65 ---- def test_level3(self): ! sw = self.reporter.system_message(3, 'an error') self.assertEquals(sw.pformat(), """\ ! <system_message level="3" type="ERROR"> <paragraph> an error *************** *** 69,73 **** def test_level4(self): ! self.assertRaises(utils.SystemWarning, self.reporter.system_warning, 4, 'a severe error, raises an exception') self.assertEquals(self.stream.getvalue(), 'Reporter: SEVERE [level 4] ' --- 69,73 ---- def test_level4(self): ! self.assertRaises(utils.SystemMessage, self.reporter.system_message, 4, 'a severe error, raises an exception') self.assertEquals(self.stream.getvalue(), 'Reporter: SEVERE [level 4] ' *************** *** 87,91 **** sw = self.reporter.debug('a debug message') self.assertEquals(sw.pformat(), """\ ! <system_warning level="0" type="DEBUG"> <paragraph> a debug message --- 87,91 ---- sw = self.reporter.debug('a debug message') self.assertEquals(sw.pformat(), """\ ! <system_message level="0" type="DEBUG"> <paragraph> a debug message *************** *** 96,100 **** sw = self.reporter.info('an informational message') self.assertEquals(sw.pformat(), """\ ! <system_warning level="1" type="INFO"> <paragraph> an informational message --- 96,100 ---- sw = self.reporter.info('an informational message') self.assertEquals(sw.pformat(), """\ ! <system_message level="1" type="INFO"> <paragraph> an informational message *************** *** 105,109 **** sw = self.reporter.warning('a warning') self.assertEquals(sw.pformat(), """\ ! <system_warning level="2" type="WARNING"> <paragraph> a warning --- 105,109 ---- sw = self.reporter.warning('a warning') self.assertEquals(sw.pformat(), """\ ! <system_message level="2" type="WARNING"> <paragraph> a warning *************** *** 114,118 **** sw = self.reporter.error('an error') self.assertEquals(sw.pformat(), """\ ! <system_warning level="3" type="ERROR"> <paragraph> an error --- 114,118 ---- sw = self.reporter.error('an error') self.assertEquals(sw.pformat(), """\ ! <system_message level="3" type="ERROR"> <paragraph> an error *************** *** 123,127 **** sw = self.reporter.severe('a severe error') self.assertEquals(sw.pformat(), """\ ! <system_warning level="4" type="SEVERE"> <paragraph> a severe error --- 123,127 ---- sw = self.reporter.severe('a severe error') self.assertEquals(sw.pformat(), """\ ! <system_message level="4" type="SEVERE"> <paragraph> a severe error *************** *** 188,192 **** self.assertEquals(self.stream.getvalue(), 'Reporter: ERROR [level 3] an error\n') ! self.assertRaises(utils.SystemWarning, self.reporter.error, 'an error', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ --- 188,192 ---- self.assertEquals(self.stream.getvalue(), 'Reporter: ERROR [level 3] an error\n') ! self.assertRaises(utils.SystemMessage, self.reporter.error, 'an error', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ *************** *** 196,204 **** def test_severe(self): ! self.assertRaises(utils.SystemWarning, self.reporter.severe, 'a severe error') self.assertEquals(self.stream.getvalue(), 'Reporter: SEVERE [level 4] a severe error\n') ! self.assertRaises(utils.SystemWarning, self.reporter.severe, 'a severe error', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ --- 196,204 ---- def test_severe(self): ! self.assertRaises(utils.SystemMessage, self.reporter.severe, 'a severe error') self.assertEquals(self.stream.getvalue(), 'Reporter: SEVERE [level 4] a severe error\n') ! self.assertRaises(utils.SystemMessage, self.reporter.severe, 'a severe error', category='lemon.curry') self.assertEquals(self.stream.getvalue(), """\ |
From: David G. <go...@us...> - 2002-02-15 22:42:49
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv26164 Modified Files: utils.py nodes.py Log Message: - Changed "system_warning" to "system_message". Index: utils.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/utils.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** utils.py 12 Feb 2002 02:16:27 -0000 1.14 --- utils.py 15 Feb 2002 22:42:44 -0000 1.15 *************** *** 15,22 **** ! class SystemWarning(Exception): ! def __init__(self, system_warning): ! Exception.__init__(self, system_warning.astext()) --- 15,22 ---- ! class SystemMessage(Exception): ! def __init__(self, system_message): ! Exception.__init__(self, system_message.astext()) *************** *** 24,36 **** """ ! Info/warning/error reporter and ``system_warning`` element generator. ! Five levels of system warnings are defined, along with corresponding methods: `debug()`, `info()`, `warning()`, `error()`, and `severe()`. There is typically one Reporter object per process. A Reporter object is instantiated with thresholds for generating warnings and errors (raising ! exceptions), a switch to turn debug output on or off, and a I/O stream for ! warnings. These are stored in the default reporting category, ''. Multiple reporting categories [#]_ may be set, each with its own warning --- 24,37 ---- """ ! Info/warning/error reporter and ``system_message`` element generator. ! Five levels of system messages are defined, along with corresponding methods: `debug()`, `info()`, `warning()`, `error()`, and `severe()`. There is typically one Reporter object per process. A Reporter object is instantiated with thresholds for generating warnings and errors (raising ! exceptions), a switch to turn debug output on or off, and an I/O stream ! for warnings. These are stored in the default reporting category, '' ! (zero-length string). Multiple reporting categories [#]_ may be set, each with its own warning *************** *** 41,49 **** closest ancestor category that has been set. ! When a system warning is generated, the stored values from its category ! (or ancestor if unset) are retrieved. The system warning level is compared to the thresholds stored in the category, and a warning or error is ! generated as appropriate. Debug warnings are produced iff the stored debug ! switch is on. Warning output is sent to the stored warning stream. .. [#]_ The concept of "categories" was inspired by the log4j project: --- 42,50 ---- 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: *************** *** 52,56 **** levels = 'DEBUG INFO WARNING ERROR SEVERE'.split() ! """List of names for system warning levels, indexed by level.""" def __init__(self, warninglevel, errorlevel, warningstream=None, debug=0): --- 53,57 ---- levels = 'DEBUG INFO WARNING ERROR SEVERE'.split() ! """List of names for system message levels, indexed by level.""" def __init__(self, warninglevel, errorlevel, warningstream=None, debug=0): *************** *** 62,68 **** - `warninglevel`: The level at or above which warning output will be sent to `warningstream`. ! - `errorlevel`: The level at or above which `SystemWarning` exceptions will be raised. ! - `debug`: Show debug (level=0) system warnings? - `warningstream`: Where warning output is sent (`None` implies `sys.stderr`). --- 63,69 ---- - `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`). *************** *** 91,101 **** return self.categories[category] ! def system_warning(self, level, comment=None, children=[], category=''): """ ! Return a system_warning object. Raise an exception or generate a warning if appropriate. """ ! sw = nodes.system_warning(comment, level=level, type=self.levels[level], *children) debug, warninglevel, errorlevel, stream = self.getcategory(category) --- 92,102 ---- return self.categories[category] ! def system_message(self, level, comment=None, children=[], category=''): """ ! Return a system_message object. Raise an exception or generate a warning if appropriate. """ ! sw = nodes.system_message(comment, level=level, type=self.levels[level], *children) debug, warninglevel, errorlevel, stream = self.getcategory(category) *************** *** 106,110 **** print >>stream, 'Reporter:', sw.astext() if level >= errorlevel: ! raise SystemWarning(sw) return sw --- 107,111 ---- print >>stream, 'Reporter:', sw.astext() if level >= errorlevel: ! raise SystemMessage(sw) return sw *************** *** 112,126 **** """ Level-0, "DEBUG": an internal reporting issue. Typically, there is no ! effect on the processing. Level-0 system warnings are handled separately from the others. """ ! return self.system_warning(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 warnings are not reported. """ ! return self.system_warning(1, comment, children, category) def warning(self, comment=None, children=[], category=''): --- 113,127 ---- """ Level-0, "DEBUG": an internal reporting issue. Typically, there is no ! effect on the processing. Level-0 system messages are handled 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=''): *************** *** 129,133 **** there may be unpredictable problems with the output. """ ! return self.system_warning(2, comment, children, category) def error(self, comment=None, children=[], category=''): --- 130,134 ---- there may be unpredictable problems with the output. """ ! return self.system_message(2, comment, children, category) def error(self, comment=None, children=[], category=''): *************** *** 136,140 **** output will contain errors. """ ! return self.system_warning(3, comment, children, category) def severe(self, comment=None, children=[], category=''): --- 137,141 ---- output will contain errors. """ ! return self.system_message(3, comment, children, category) def severe(self, comment=None, children=[], category=''): *************** *** 142,148 **** Level-4, "SEVERE": a severe error that must be addressed. If ignored, the output will contain severe errors. Typically level-4 system ! warnings are turned into exceptions which halt processing. """ ! return self.system_warning(4, comment, children, category) --- 143,149 ---- Level-4, "SEVERE": a severe error that must be addressed. If ignored, the output will contain severe errors. Typically level-4 system ! messages are turned into exceptions which halt processing. """ ! return self.system_message(4, comment, children, category) Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** nodes.py 13 Feb 2002 02:26:54 -0000 1.28 --- nodes.py 15 Feb 2002 22:42:44 -0000 1.29 *************** *** 465,469 **** self.reporter = reporter ! """System warning generator.""" self.languagecode = languagecode --- 465,469 ---- self.reporter = reporter ! """System message generator.""" self.languagecode = languagecode *************** *** 546,550 **** and t['refuri'] == refuri: level = 1 # just inform if refuri's identical ! sw = self.reporter.system_warning( level, 'Duplicate explicit target name: "%s"' % name) innode += sw --- 546,550 ---- and t['refuri'] == refuri: level = 1 # just inform if refuri's identical ! sw = self.reporter.system_message( level, 'Duplicate explicit target name: "%s"' % name) innode += sw *************** *** 703,707 **** ! class system_warning(Special, PreBibliographic, Element): def __init__(self, comment=None, *children, **attributes): --- 703,707 ---- ! class system_message(Special, PreBibliographic, Element): def __init__(self, comment=None, *children, **attributes): *************** *** 753,757 **** reference revision row section short_option status strong substitution_definition ! substitution_reference subtitle system_warning table target tbody term tgroup thead tip title transition version vms_option --- 753,757 ---- reference revision row section short_option status strong substitution_definition ! substitution_reference subtitle system_message table target tbody term tgroup thead tip title transition version vms_option |
From: David G. <go...@us...> - 2002-02-13 02:29:43
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv20090/dps Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** HISTORY.txt 6 Feb 2002 03:11:28 -0000 1.37 --- HISTORY.txt 13 Feb 2002 02:29:39 -0000 1.38 *************** *** 78,82 **** - 'errorhandler' -> 'reporter'. ``dps.utils.Reporter`` reform. - Added document.languagecode. ! - Added Visitor classes & Node.walk(). - Improved ``__repr__()``. - Improved some names. --- 78,82 ---- - 'errorhandler' -> 'reporter'. ``dps.utils.Reporter`` reform. - Added document.languagecode. ! - Added Visitor classes, ``Node.walk()`` & ``Node.walkabout()``. - Improved ``__repr__()``. - Improved some names. |
From: David G. <go...@us...> - 2002-02-13 02:26:57
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv18778/dps/dps Modified Files: nodes.py Log Message: - Added ``Node.walkabout()`` and "depart" methods to visitors. Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** nodes.py 12 Feb 2002 02:21:18 -0000 1.27 --- nodes.py 13 Feb 2002 02:26:54 -0000 1.28 *************** *** 43,49 **** def walk(self, visitor): """ ! Traverse a tree of `Node` objects, calling ``visit_*`` methods of ! `visitor`. If there is no ``visit_particular_node`` method for a node ! of type ``particular_node``, the ``unknown_visit`` method is called. Doesn't handle arbitrary modification in-place during the traversal. --- 43,50 ---- def walk(self, visitor): """ ! Traverse a tree of `Node` objects, calling ``visit_...`` methods of ! `visitor` when entering each node. If there is no ! ``visit_particular_node`` method for a node of type ! ``particular_node``, the ``unknown_visit`` method is called. Doesn't handle arbitrary modification in-place during the traversal. *************** *** 60,63 **** --- 61,84 ---- children[i].walk(visitor) + def walkabout(self, visitor): + """ + Perform a tree traversal similarly to `Node.walk()`, except also call + ``depart_...`` methods before exiting each node. If there is no + ``depart_particular_node`` method for a node of type + ``particular_node``, the ``unknown_departure`` method is called. + + Parameter `visitor`: A `NodeVisitor` object, containing ``visit_...`` + and ``depart_...`` methods for each `Node` subclass encountered. + """ + method = getattr(visitor, 'visit_' + self.__class__.__name__, + visitor.unknown_visit) + method(self) + children = self.getchildren() + for i in range(len(children)): + children[i].walkabout(visitor) + method = getattr(visitor, 'depart_' + self.__class__.__name__, + visitor.unknown_departure) + method(self) + class Text(Node, MutableString): *************** *** 748,752 **** override individual methods for specific and useful behaviour. The "``visit_`` + node class name" method is called by `Node.walk()` upon ! entering a node. .. [GoF95] Gamma, Helm, Johnson, Vlissides. *Design Patterns: Elements of --- 769,774 ---- override individual methods for specific and useful behaviour. The "``visit_`` + node class name" method is called by `Node.walk()` upon ! entering a node. `Node.walkabout()` also calls the "``depart_`` + node ! class name" method before exiting a node. .. [GoF95] Gamma, Helm, Johnson, Vlissides. *Design Patterns: Elements of *************** *** 759,768 **** def unknown_visit(self, node): ! """Called for unknown `Node` types. Does nothing unless overridden.""" ! pass # Save typing with dynamic definitions. for name in node_class_names: exec """def visit_%s(self, node): pass\n""" % name del name --- 781,805 ---- def unknown_visit(self, node): ! """ ! Called when entering unknown `Node` types. ! ! Raise an exception unless overridden. ! """ ! raise NotImplementedError('visiting unknown node type: %s' ! % node.__class__.__name__) ! ! def unknown_departure(self, node): ! """ ! Called before exiting unknown `Node` types. ! ! Raise exception unless overridden. ! """ ! raise NotImplementedError('departing unknown node type: %s' ! % node.__class__.__name__) # Save typing with dynamic definitions. for name in node_class_names: exec """def visit_%s(self, node): pass\n""" % name + exec """def depart_%s(self, node): pass\n""" % name del name *************** *** 773,784 **** Generic "Visitor" abstract superclass, for simple traversals. ! Unless overridden, each ``visit_*`` method calls `default_visit()`. ! ``default_visit()`` must be overridden in subclasses. ! Define fully generic visitors by overriding ``default_visit()`` only. ! Define semi-generic visitors by overriding individual ``visit_*()`` ! methods also. ! `NodeVisitor.unknown_visit()` should be overridden for default behavior. """ --- 810,824 ---- Generic "Visitor" abstract superclass, for simple traversals. ! Unless overridden, each ``visit_...`` method calls `default_visit()`, and ! each ``depart_...`` method (when using `Node.walkabout()`) calls ! `default_departure()`. `default_visit()` (`default_departure()`) must be ! overridden in subclasses. ! Define fully generic visitors by overriding `default_visit()` ! (`default_departure()`) only. Define semi-generic visitors by overriding ! individual ``visit_...()`` (``depart_...()``) methods also. ! `NodeVisitor.unknown_visit()` (`NodeVisitor.unknown_departure()`) should ! be overridden for default behavior. """ *************** *** 787,793 **** --- 827,839 ---- raise NotImplementedError + def default_departure(self, node): + """Override for generic, uniform traversals.""" + raise NotImplementedError + # Save typing with dynamic definitions. for name in node_class_names: exec """def visit_%s(self, node): self.default_visit(node)\n""" % name + exec """def depart_%s(self, node): + self.default_departure(node)\n""" % name del name |
From: David G. <go...@us...> - 2002-02-13 02:25:31
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv17976/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.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** dps-notes.txt 7 Feb 2002 02:03:30 -0000 1.24 --- dps-notes.txt 13 Feb 2002 02:25:29 -0000 1.25 *************** *** 440,473 **** - Visitors - ======== - - To nodes.py, add ``Node.walkabout()``, ``Visitor.leave_*()``, and - ``GenericVisitor.default_leave()`` methods to catch elements on the - way out? Here's ``Node.walkabout()``:: - - def walkabout(self, visitor, ancestry=()): - """ - Traverse a tree of `Node` objects. Call `visitor`'s - ``visit_...`` method (upon initial entry) **and** its - ``leave_...`` method (before exiting). - - Parameters: - - - `visitor`: A `Visitor` object, containing a ``visit_...`` - and ``leave_...`` method for each `Node` subclass - encountered. - - `ancestry`: A list of (parent, index) pairs. `self`'s parent - is the last entry. - """ - method = getattr(visitor, 'visit_' + self.__class__.__name__) - method(self, ancestry) - children = self.getchildren() - for i in range(len(children)): - children[i].walkabout(visitor, ancestry + ((self, i),)) - method = getattr(visitor, 'leave_' + self.__class__.__name__) - method(self, ancestry) - - Mixing Automatic and Manual Footnote Numbering ============================================== --- 440,443 ---- |
From: David G. <go...@us...> - 2002-02-12 02:21:23
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv31850/dps/dps Modified Files: nodes.py Log Message: Renamed node categories; added ``NodeVisitor.unknown_visit()``. Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** nodes.py 6 Feb 2002 02:44:42 -0000 1.26 --- nodes.py 12 Feb 2002 02:21:18 -0000 1.27 *************** *** 44,48 **** """ Traverse a tree of `Node` objects, calling ``visit_*`` methods of ! `visitor`. Doesn't handle arbitrary modification in-place during the traversal. --- 44,49 ---- """ Traverse a tree of `Node` objects, calling ``visit_*`` methods of ! `visitor`. If there is no ``visit_particular_node`` method for a node ! of type ``particular_node``, the ``unknown_visit`` method is called. Doesn't handle arbitrary modification in-place during the traversal. *************** *** 52,56 **** ``visit_...`` method for each `Node` subclass encountered. """ ! method = getattr(visitor, 'visit_' + self.__class__.__name__) method(self) children = self.getchildren() --- 53,58 ---- ``visit_...`` method for each `Node` subclass encountered. """ ! method = getattr(visitor, 'visit_' + self.__class__.__name__, ! visitor.unknown_visit) method(self) children = self.getchildren() *************** *** 395,402 **** class Root: pass ! class Title: pass class Bibliographic: pass class Structural: pass --- 397,410 ---- class Root: pass ! class Titular: pass class Bibliographic: pass + + class PreBibliographic: + """Category of Node which may occur before Bibliographic Nodes.""" + pass + + class Structural: pass *************** *** 405,413 **** class General(Body): pass ! class List(Body): pass class Admonition(Body): pass ! class Special(Body): pass class Component: pass --- 413,425 ---- class General(Body): pass ! class Sequential(Body): pass class Admonition(Body): pass ! ! class Special(Body): ! """Special internal body elements, not true document components.""" ! pass ! class Component: pass *************** *** 416,420 **** ! class Reference(ToBeResolved): refnode = None --- 428,432 ---- ! class Referential(ToBeResolved): refnode = None *************** *** 586,591 **** # ================ ! class title(Title, TextElement): pass ! class subtitle(Title, TextElement): pass --- 598,603 ---- # ================ ! class title(Titular, PreBibliographic, TextElement): pass ! class subtitle(Titular, PreBibliographic, TextElement): pass *************** *** 620,637 **** class paragraph(General, TextElement): pass ! class bullet_list(List, Element): pass ! class enumerated_list(List, Element): pass class list_item(Component, Element): pass ! class definition_list(List, Element): pass class definition_list_item(Component, Element): pass class term(Component, TextElement): pass class classifier(Component, TextElement): pass class definition(Component, Element): pass ! class field_list(List, Element): pass class field(Component, Element): pass class field_name(Component, TextElement): pass class field_argument(Component, TextElement): pass class field_body(Component, Element): pass ! class option_list(List, Element): pass class option_list_item(Component, Element): pass class option(Component, Element): pass --- 632,649 ---- class paragraph(General, TextElement): pass ! class bullet_list(Sequential, Element): pass ! class enumerated_list(Sequential, Element): pass class list_item(Component, Element): pass ! class definition_list(Sequential, Element): pass class definition_list_item(Component, Element): pass class term(Component, TextElement): pass class classifier(Component, TextElement): pass class definition(Component, Element): pass ! class field_list(Sequential, Element): pass class field(Component, Element): pass class field_name(Component, TextElement): pass class field_argument(Component, TextElement): pass class field_body(Component, Element): pass ! class option_list(Sequential, Element): pass class option_list_item(Component, Element): pass class option(Component, Element): pass *************** *** 653,657 **** class hint(Admonition, Element): pass class warning(Admonition, Element): pass ! class comment(Special, TextElement): pass class substitution_definition(Special, TextElement): pass class target(Special, Inline, TextElement, ToBeResolved): pass --- 665,669 ---- class hint(Admonition, Element): pass class warning(Admonition, Element): pass ! class comment(Special, PreBibliographic, TextElement): pass class substitution_definition(Special, TextElement): pass class target(Special, Inline, TextElement, ToBeResolved): pass *************** *** 670,678 **** ! class system_warning(Special, Element): def __init__(self, comment=None, *children, **attributes): - #print ('nodes.system_warning.__init__: comment=%r, children=%r, ' - # 'attributes=%r' % (comment, children, attributes)) if comment: p = paragraph('', comment) --- 682,688 ---- ! class system_warning(Special, PreBibliographic, Element): def __init__(self, comment=None, *children, **attributes): if comment: p = paragraph('', comment) *************** *** 691,699 **** class emphasis(Inline, TextElement): pass class strong(Inline, TextElement): pass ! class interpreted(Inline, Reference, TextElement): pass class literal(Inline, TextElement): pass ! class reference(Inline, Reference, TextElement): pass ! class footnote_reference(Inline, Reference, TextElement): pass ! class substitution_reference(Inline, Reference, TextElement): pass class image(General, Inline, TextElement): pass class problematic(Inline, TextElement): pass --- 701,709 ---- class emphasis(Inline, TextElement): pass class strong(Inline, TextElement): pass ! class interpreted(Inline, Referential, TextElement): pass class literal(Inline, TextElement): pass ! class reference(Inline, Referential, TextElement): pass ! class footnote_reference(Inline, Referential, TextElement): pass ! class substitution_reference(Inline, Referential, TextElement): pass class image(General, Inline, TextElement): pass class problematic(Inline, TextElement): pass *************** *** 748,751 **** --- 758,765 ---- self.doctree = doctree + def unknown_visit(self, node): + """Called for unknown `Node` types. Does nothing unless overridden.""" + pass + # Save typing with dynamic definitions. for name in node_class_names: *************** *** 765,768 **** --- 779,784 ---- Define semi-generic visitors by overriding individual ``visit_*()`` methods also. + + `NodeVisitor.unknown_visit()` should be overridden for default behavior. """ |
From: David G. <go...@us...> - 2002-02-12 02:19:46
|
Update of /cvsroot/docstring/dps/dps/readers In directory usw-pr-cvs1:/tmp/cvs-serv31547/dps/dps/readers Modified Files: standalone.py Log Message: rearranged logic Index: standalone.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/readers/standalone.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** standalone.py 7 Feb 2002 01:59:59 -0000 1.2 --- standalone.py 12 Feb 2002 02:19:43 -0000 1.3 *************** *** 36,39 **** references.Substitutions,) ! def scan(self, source): ! self.scanfile(source) --- 36,39 ---- references.Substitutions,) ! def scan(self): ! self.input = self.scanfile(self.source) |