docstring-checkins Mailing List for Docstring Processing System (Page 6)
Status: Pre-Alpha
Brought to you by:
goodger
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(53) |
Sep
(54) |
Oct
(26) |
Nov
(27) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(60) |
Feb
(85) |
Mar
(94) |
Apr
(40) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: David G. <go...@us...> - 2002-03-04 04:43:28
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv13585/dps/spec Modified Files: gpdi.dtd Log Message: - Removed "abstract" - Added "topic". - Added "pending". - Added "citation" and "citation_reference". Index: gpdi.dtd =================================================================== RCS file: /cvsroot/docstring/dps/spec/gpdi.dtd,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** gpdi.dtd 1 Mar 2002 03:15:18 -0000 1.35 --- gpdi.dtd 4 Mar 2002 04:43:25 -0000 1.36 *************** *** 111,120 **** <!ENTITY % body.elements " paragraph | literal_block | block_quote | doctest_block| table ! | figure | image | footnote | bullet_list | enumerated_list | definition_list | field_list | option_list ! | note | tip | hint | warning | error | attention | caution ! | danger | important ! | target | substitution_definition | comment | system_message %additional.body.elements; "> --- 111,121 ---- <!ENTITY % body.elements " paragraph | literal_block | block_quote | doctest_block| table ! | figure | image | footnote | citation | bullet_list | enumerated_list | definition_list | field_list | option_list ! | attention | caution | danger | error | hint | important | note ! | tip | warning ! | target | substitution_definition | comment | pending ! | system_message %additional.body.elements; "> *************** *** 122,127 **** <!ENTITY % inline.elements " emphasis | strong | interpreted | literal ! | reference | footnote_reference | substitution_reference ! | target | image | problematic %additional.inline.elements; "> --- 123,128 ---- <!ENTITY % inline.elements " emphasis | strong | interpreted | literal ! | reference | footnote_reference | citation_reference ! | substitution_reference | target | image | problematic %additional.inline.elements; "> *************** *** 130,134 **** <!ENTITY % structure.model ! " ( ((%body.elements; | transition)+, (%structural.elements;)*) | (%structural.elements;)+ ) "> --- 131,137 ---- <!ENTITY % structure.model ! " ( ( (%body.elements; | topic)+, ! (transition, (%body.elements; | topic)+ )*, ! (%structural.elements;)* ) | (%structural.elements;)+ ) "> *************** *** 169,173 **** <!-- Optional elements may be generated by internal processing. --> <!ELEMENT document ! ((title, subtitle?)?, docinfo?, abstract?, %structure.model;)> <!ATTLIST document %basic.atts;> --- 172,176 ---- <!-- Optional elements may be generated by internal processing. --> <!ELEMENT document ! ((title, subtitle?)?, docinfo?, %structure.model;)> <!ATTLIST document %basic.atts;> *************** *** 230,239 **** --> - <!ELEMENT abstract (%body.elements;)+> - <!ATTLIST abstract %basic.atts;> - <!ELEMENT section (title, %structure.model;)> <!ATTLIST section %basic.atts;> <!ELEMENT transition EMPTY> <!ATTLIST transition %basic.atts;> --- 233,242 ---- --> <!ELEMENT section (title, %structure.model;)> <!ATTLIST section %basic.atts;> + <!ELEMENT topic (title, (%body.elements;)+)> + <!ATTLIST topic %basic.atts;> + <!ELEMENT transition EMPTY> <!ATTLIST transition %basic.atts;> *************** *** 340,357 **** %fixedspace.att;> ! <!ELEMENT note (%body.elements;)+> ! <!ATTLIST note %basic.atts;> ! ! <!ELEMENT tip (%body.elements;)+> ! <!ATTLIST tip %basic.atts;> ! ! <!ELEMENT hint (%body.elements;)+> ! <!ATTLIST hint %basic.atts;> ! ! <!ELEMENT warning (%body.elements;)+> ! <!ATTLIST warning %basic.atts;> ! ! <!ELEMENT error (%body.elements;)+> ! <!ATTLIST error %basic.atts;> <!ELEMENT caution (%body.elements;)+> --- 343,348 ---- %fixedspace.att;> ! <!ELEMENT attention (%body.elements;)+> ! <!ATTLIST attention %basic.atts;> <!ELEMENT caution (%body.elements;)+> *************** *** 361,367 **** --- 352,373 ---- <!ATTLIST danger %basic.atts;> + <!ELEMENT error (%body.elements;)+> + <!ATTLIST error %basic.atts;> + + <!ELEMENT hint (%body.elements;)+> + <!ATTLIST hint %basic.atts;> + <!ELEMENT important (%body.elements;)+> <!ATTLIST important %basic.atts;> + <!ELEMENT note (%body.elements;)+> + <!ATTLIST note %basic.atts;> + + <!ELEMENT tip (%body.elements;)+> + <!ATTLIST tip %basic.atts;> + + <!ELEMENT warning (%body.elements;)+> + <!ATTLIST warning %basic.atts;> + <!ELEMENT footnote (label?, (%body.elements;)+)> <!ATTLIST footnote *************** *** 369,372 **** --- 375,381 ---- %auto.att;> + <!ELEMENT citation (label, (%body.elements;)+)> + <!ATTLIST citation %basic.atts;> + <!ELEMENT label (#PCDATA)> <!ATTLIST label %basic.atts;> *************** *** 387,390 **** --- 396,404 ---- %fixedspace.att;> + <!ELEMENT pending (field_list)> + <!ATTLIST pending + %basic.atts; + directive CDATA #REQUIRED> + <!ELEMENT figure (image, ((caption, legend?) | legend) > <!ATTLIST figure %basic.atts;> *************** *** 461,464 **** --- 475,483 ---- %reference.atts; %auto.att;> + + <!ELEMENT citation_reference (#PCDATA)> + <!ATTLIST citation_reference + %basic.atts; + %reference.atts;> <!ELEMENT substitution_reference (%text.model;)> |
From: David G. <go...@us...> - 2002-03-04 04:40:31
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv13052/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.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_docinfo.py 1 Mar 2002 03:14:36 -0000 1.8 --- test_docinfo.py 4 Mar 2002 04:40:28 -0000 1.9 *************** *** 51,55 **** <date> 2001-08-11 ! <abstract> <paragraph> There can only be one abstract. --- 51,57 ---- <date> 2001-08-11 ! <topic class="abstract"> ! <title> ! Abstract <paragraph> There can only be one abstract. *************** *** 91,95 **** <date> 2001-08-11 ! <abstract> <paragraph> Abstract 1. --- 93,99 ---- <date> 2001-08-11 ! <topic class="abstract"> ! <title> ! Abstract <paragraph> Abstract 1. |
From: David G. <go...@us...> - 2002-03-01 03:19:44
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv1752/dps Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** HISTORY.txt 23 Feb 2002 16:54:23 -0000 1.42 --- HISTORY.txt 1 Mar 2002 03:19:41 -0000 1.43 *************** *** 92,95 **** --- 92,96 ---- - Modified post-parse system message storage. - Added 'id' attribute support to ``document``. + - Reworked option lists. * dps/roman.py: Added to project. Written by and courtesy of Mark *************** *** 191,196 **** - Changed field_argument's model to PCDATA. - Added option_list and doctest_block from ppdi.dtd. - - Added vms_option element to option. - - Added support for 'option_list' attribute 'optarg_delimiter'. - Added classifier element to definition_list_item. - Added dupname attribute to %basic.atts; for duplicate names. --- 192,195 ---- *************** *** 223,226 **** --- 222,226 ---- - Added 'type' attribute to 'system_warning', removed 'warning'. - Changed "system_warning" to "system_message". + - Reworked option lists. * spec/pdpi.dtd: |
From: David G. <go...@us...> - 2002-03-01 03:17:09
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv1222/dps/dps Modified Files: nodes.py Log Message: - Reworked option lists. Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** nodes.py 22 Feb 2002 02:11:14 -0000 1.32 --- nodes.py 1 Mar 2002 03:17:06 -0000 1.33 *************** *** 65,69 **** except SkipSiblings: pass ! except (SkipChildren, SkipDeparture): pass --- 65,69 ---- except SkipSiblings: pass ! except (SkipChildren, SkipNode): pass *************** *** 91,95 **** except SkipChildren: pass ! except SkipDeparture: return name = 'depart_' + self.__class__.__name__ --- 91,95 ---- except SkipChildren: pass ! except SkipNode: return name = 'depart_' + self.__class__.__name__ *************** *** 726,736 **** 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 ! class short_option(Component, TextElement): pass ! class long_option(Component, TextElement): pass ! class vms_option(Component, TextElement): pass ! class option_argument(Component, TextElement): pass class description(Component, Element): pass class literal_block(General, TextElement): pass --- 726,756 ---- class field_argument(Component, TextElement): pass class field_body(Component, Element): pass + + + class option(Component, Element): + + child_text_separator = '' + + + class option_argument(Component, TextElement): + + def astext(self): + return self.get('delimiter', ' ') + TextElement.astext(self) + + + class option_group(Component, Element): + + child_text_separator = ', ' + + class option_list(Sequential, Element): pass ! ! ! class option_list_item(Component, Element): ! ! child_text_separator = ' ' ! ! ! class option_string(Component, TextElement): pass class description(Component, Element): pass class literal_block(General, TextElement): pass *************** *** 807,819 **** hint image important interpreted ! label legend list_item literal literal_block long_option note ! option option_argument option_list option_list_item organization paragraph problematic 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 warning""".split() """A list of names of all concrete Node subclasses.""" --- 827,840 ---- hint image important interpreted ! label legend list_item literal literal_block note ! option option_argument option_group option_list option_list_item ! option_string organization paragraph problematic reference revision row ! section status strong substitution_definition substitution_reference subtitle system_message table target tbody term tgroup thead tip title transition ! version warning""".split() """A list of names of all concrete Node subclasses.""" *************** *** 903,905 **** class SkipChildren(VisitorException): pass class SkipSiblings(VisitorException): pass ! class SkipDeparture(VisitorException): pass --- 924,926 ---- class SkipChildren(VisitorException): pass class SkipSiblings(VisitorException): pass ! class SkipNode(VisitorException): pass |
From: David G. <go...@us...> - 2002-03-01 03:16:25
|
Update of /cvsroot/docstring/dps/dps/writers In directory usw-pr-cvs1:/tmp/cvs-serv1041/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.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** html.py 23 Feb 2002 16:51:31 -0000 1.4 --- html.py 1 Mar 2002 03:16:22 -0000 1.5 *************** *** 42,47 **** nodes.NodeVisitor.__init__(self, doctree) self.language = languages.getlanguage(doctree.languagecode) ! self.head = ['<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"\n' ! ' "http://www.w3.org/TR/html4/strict.dtd">\n', '<HTML LANG="%s">\n<HEAD>\n' % doctree.languagecode, '<LINK REL="StyleSheet" HREF="default.css"' --- 42,48 ---- nodes.NodeVisitor.__init__(self, doctree) self.language = languages.getlanguage(doctree.languagecode) ! self.head = ['<!DOCTYPE HTML PUBLIC' ! ' "-//W3C//DTD HTML 4.01 Transitional//EN"\n' ! ' "http://www.w3.org/TR/html4/loose.dtd">\n', '<HTML LANG="%s">\n<HEAD>\n' % doctree.languagecode, '<LINK REL="StyleSheet" HREF="default.css"' *************** *** 50,53 **** --- 51,55 ---- self.foot = ['</BODY>\n</HTML>\n'] self.sectionlevel = 0 + self.context = [] def astext(self): *************** *** 63,81 **** def starttag(self, node, tagname, suffix='\n', **attributes): ! attrs = {} for (name, value) in attributes.items(): ! attrs[name.lower()] = value for att in ('class',): # append to node attribute if node.has_key(att): ! if attrs.has_key(att): ! attrs[att] = node[att] + ' ' + attrs[att] for att in ('id',): # node attribute overrides if node.has_key(att): ! attrs[att] = node[att] ! attlist = attrs.items() attlist.sort() return '<%s>%s' % (' '.join([tagname.upper()] + ['%s="%s"' % (name.upper(), ! self.encode(value)) for name, value in attlist]), suffix) --- 65,83 ---- def starttag(self, node, tagname, suffix='\n', **attributes): ! atts = {} for (name, value) in attributes.items(): ! atts[name.lower()] = value for att in ('class',): # append to node attribute if node.has_key(att): ! if atts.has_key(att): ! atts[att] = node[att] + ' ' + atts[att] for att in ('id',): # node attribute overrides if node.has_key(att): ! atts[att] = node[att] ! attlist = atts.items() attlist.sort() return '<%s>%s' % (' '.join([tagname.upper()] + ['%s="%s"' % (name.upper(), ! self.encode(str(value))) for name, value in attlist]), suffix) *************** *** 119,126 **** def visit_block_quote(self, node): ! pass def depart_block_quote(self, node): ! pass def visit_bullet_list(self, node): --- 121,128 ---- def visit_block_quote(self, node): ! self.body.append(self.starttag(node, 'blockquote')) def depart_block_quote(self, node): ! self.body.append('</BLOCKQUOTE>\n') def visit_bullet_list(self, node): *************** *** 132,145 **** 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): --- 134,147 ---- def visit_caption(self, node): ! self.body.append(self.starttag(node, 'p', '', CLASS='caption')) def depart_caption(self, node): ! self.body.append('</P>\n') def visit_caution(self, node): ! self.visit_admonition(node, 'caution') def depart_caution(self, node): ! self.depart_admonition() def visit_classifier(self, node): *************** *** 151,155 **** def visit_colspec(self, node): ! pass def depart_colspec(self, node): --- 153,160 ---- def visit_colspec(self, node): ! atts = {} ! #if node.has_key('colwidth'): ! # atts['width'] = str(node['colwidth']) + '*' ! self.body.append(self.starttag(node, 'col', **atts)) def depart_colspec(self, node): *************** *** 175,182 **** def visit_danger(self, node): ! pass def depart_danger(self, node): ! pass def visit_date(self, node): --- 180,187 ---- def visit_danger(self, node): ! self.visit_admonition(node, 'danger') def depart_danger(self, node): ! self.depart_admonition() def visit_date(self, node): *************** *** 206,223 **** def visit_description(self, node): ! pass def depart_description(self, node): ! pass def visit_docinfo(self, node): ! self.body.append(self.starttag(node, 'DIV', CLASS='docinfo')) ! self.body.append('<TABLE FRAME="void" RULES="none">\n' ! '<COL CLASS="docinfo_name">\n' '<COL CLASS="docinfo_content">\n' '<TBODY VALIGN="top">\n') def depart_docinfo(self, node): ! self.body.append('</TABLE>\n</TBODY>\n</DIV>\n') def visit_docinfo_item(self, node, name): --- 211,228 ---- def visit_description(self, node): ! self.body.append('<TD>\n') def depart_description(self, node): ! self.body.append('</TD>') def visit_docinfo(self, node): ! self.body.append(self.starttag(node, 'table', CLASS='docinfo', ! frame="void", rules="none")) ! self.body.append('<COL CLASS="docinfo_name">\n' '<COL CLASS="docinfo_content">\n' '<TBODY VALIGN="top">\n') def depart_docinfo(self, node): ! self.body.append('</TBODY>\n</TABLE>\n') def visit_docinfo_item(self, node, name): *************** *** 233,240 **** def visit_doctest_block(self, node): ! pass def depart_doctest_block(self, node): ! pass def visit_document(self, node): --- 238,245 ---- def visit_doctest_block(self, node): ! self.body.append(self.starttag(node, 'pre', CLASS='doctest_block')) def depart_doctest_block(self, node): ! self.body.append('</PRE>\n') def visit_document(self, node): *************** *** 251,332 **** 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): ! 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): --- 256,383 ---- def visit_entry(self, node): ! if isinstance(node.parent.parent, nodes.thead): ! tagname = 'th' ! else: ! tagname = 'td' ! atts = {} ! if node.has_key('morerows'): ! atts['rowspan'] = node['morerows'] + 1 ! if node.has_key('morecols'): ! atts['colspan'] = node['morecols'] + 1 ! self.body.append(self.starttag(node, tagname, **atts)) ! self.context.append('</%s>' % tagname.upper()) ! if len(node) == 0: # empty cell ! self.body.append(' ') def depart_entry(self, node): ! self.body.append(self.context.pop()) def visit_enumerated_list(self, node): ! """ ! The 'start' attribute does not conform to HTML 4.01's strict.dtd, but ! CSS1 doesn't help. CSS2 isn't widely enough supported yet to be ! usable. ! """ ! atts = {} ! if node.has_key('start'): ! atts['start'] = node['start'] ! if node.has_key('enumtype'): ! atts['class'] = node['enumtype'] ! # @@@ To do: prefix, suffix. How? Change prefix/suffix to a ! # single "format" attribute? Use CSS2? ! self.body.append(self.starttag(node, 'ol', **atts)) def depart_enumerated_list(self, node): ! self.body.append('</OL>\n') def visit_error(self, node): ! self.visit_admonition(node, 'error') def depart_error(self, node): ! self.depart_admonition() def visit_field(self, node): ! self.body.append(self.starttag(node, 'tr', CLASS='field')) def depart_field(self, node): ! self.body.append('</TR>\n') def visit_field_argument(self, node): ! self.body.append(' ') ! self.body.append(self.starttag(node, 'span', '', ! CLASS='field_argument')) def depart_field_argument(self, node): ! self.body.append('</SPAN>') def visit_field_body(self, node): ! self.body.append(':</P>\n</TD><TD>') ! self.body.append(self.starttag(node, 'div', CLASS='field_body')) def depart_field_body(self, node): ! self.body.append('</DIV></TD>\n') def visit_field_list(self, node): ! self.body.append(self.starttag(node, 'table', frame='void', ! rules='none')) ! self.body.append('<COL CLASS="field_name">\n' ! '<COL CLASS="field_body">\n' ! '<TBODY VALIGN="top">\n') def depart_field_list(self, node): ! self.body.append('</TBODY>\n</TABLE>\n') def visit_field_name(self, node): ! self.body.append('<TD>\n') ! self.body.append(self.starttag(node, 'p', '', CLASS='field_name')) def depart_field_name(self, node): + """ + Leave the end tag to `self.visit_field_body()`, in case there are any + field_arguments. + """ pass def visit_figure(self, node): ! self.body.append(self.starttag(node, 'div', CLASS='figure')) def depart_figure(self, node): ! self.body.append('</DIV>\n') def visit_footnote(self, node): ! self.body.append(self.starttag(node, 'table', CLASS='footnote', ! frame="void", rules="none")) ! self.body.append('<COL CLASS="label">\n' ! '<COL>\n' ! '<TBODY VALIGN="top">\n' ! '<TR><TD>\n') def depart_footnote(self, node): ! self.body.append('</TD></TR>\n' ! '</TBODY>\n</TABLE>\n') def visit_footnote_reference(self, node): ! href = '' ! if node.has_key('refname'): ! href = '#' + self.doctree.nameids[node['refname']] ! self.body.append(self.starttag(node, 'a', '[', href=href, ! CLASS='footnote_reference')) def depart_footnote_reference(self, node): ! self.body.append(']</A>') def visit_hint(self, node): ! self.visit_admonition(node, 'hint') def depart_hint(self, node): ! self.depart_admonition() def visit_image(self, node): ! atts = node.attributes.copy() ! atts['src'] = atts['uri'] ! del atts['uri'] ! if not atts.has_key('alt'): ! atts['alt'] = atts['src'] ! self.body.append(self.starttag(node, 'img', '', **atts)) def depart_image(self, node): *************** *** 334,341 **** def visit_important(self, node): ! pass def depart_important(self, node): ! pass def visit_interpreted(self, node): --- 385,392 ---- def visit_important(self, node): ! self.visit_admonition(node, 'important') def depart_important(self, node): ! self.depart_admonition() def visit_interpreted(self, node): *************** *** 346,359 **** 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): --- 397,411 ---- def visit_label(self, node): ! self.body.append(self.starttag(node, 'p', '[', CLASS='label')) def depart_label(self, node): ! self.body.append(']</P>\n' ! '</TD><TD>\n') def visit_legend(self, node): ! self.body.append(self.starttag(node, 'div', CLASS='legend')) def depart_legend(self, node): ! self.body.append('</DIV>\n') def visit_list_item(self, node): *************** *** 370,383 **** 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): --- 422,429 ---- def visit_literal_block(self, node): ! self.body.append(self.starttag(node, 'pre', CLASS='literal_block')) def depart_literal_block(self, node): ! self.body.append('</PRE>\n') def visit_meta(self, node): *************** *** 388,419 **** 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): --- 434,495 ---- def visit_note(self, node): ! self.visit_admonition(node, 'note') def depart_note(self, node): ! self.depart_admonition() def visit_option(self, node): ! if self.context[-1]: ! self.body.append(', ') def depart_option(self, node): ! self.context[-1] += 1 def visit_option_argument(self, node): ! self.body.append(node.get('delimiter', ' ')) ! self.body.append(self.starttag(node, 'span', '', ! CLASS='option_argument')) def depart_option_argument(self, node): ! self.body.append('</SPAN>') ! ! def visit_option_group(self, node): ! atts = {} ! if len(node.astext()) > 14: ! atts['colspan'] = 2 ! self.context.append('</TR>\n<TR><TD> </TD>') ! else: ! self.context.append('') ! self.body.append(self.starttag(node, 'td', **atts)) ! self.body.append('<P><CODE>') ! self.context.append(0) ! ! def depart_option_group(self, node): ! self.context.pop() ! self.body.append('</CODE></P>\n</TD>') ! self.body.append(self.context.pop()) def visit_option_list(self, node): ! self.body.append( ! self.starttag(node, 'table', CLASS='option_list', ! frame="void", rules="none", cellspacing=12)) ! self.body.append('<COL CLASS="option">\n' ! '<COL CLASS="description">\n' ! '<TBODY VALIGN="top">\n') def depart_option_list(self, node): ! self.body.append('</TBODY>\n</TABLE>\n') def visit_option_list_item(self, node): ! self.body.append(self.starttag(node, 'tr', '')) def depart_option_list_item(self, node): ! self.body.append('</TR>\n') ! ! def visit_option_string(self, node): ! self.body.append(self.starttag(node, 'span', '', CLASS='option')) ! ! def depart_option_string(self, node): ! self.body.append('</SPAN>') def visit_organization(self, node): *************** *** 436,443 **** def visit_reference(self, node): ! pass def depart_reference(self, node): ! pass def visit_revision(self, node): --- 512,527 ---- def visit_reference(self, node): ! if node.has_key('refuri'): ! href = node['refuri'] ! elif node.has_key('refid'): ! href = '#' + node['refid'] ! elif node.has_key('refname'): ! # @@@ Check for non-existent mappings. Here or in a transform? ! href = '#' + self.doctree.nameids[node['refname']] ! self.body.append(self.starttag(node, 'a', '', href=href, ! CLASS='reference')) def depart_reference(self, node): ! self.body.append('</A>') def visit_revision(self, node): *************** *** 448,455 **** def visit_row(self, node): ! pass def depart_row(self, node): ! pass def visit_section(self, node): --- 532,539 ---- def visit_row(self, node): ! self.body.append(self.starttag(node, 'tr', '')) def depart_row(self, node): ! self.body.append('</TR>\n') def visit_section(self, node): *************** *** 461,470 **** self.body.append('</DIV>\n') - def visit_short_option(self, node): - pass - - def depart_short_option(self, node): - pass - def visit_status(self, node): self.visit_docinfo_item(node, 'status') --- 545,548 ---- *************** *** 498,502 **** def visit_system_message(self, node): ! self.body.append(self.starttag(node, 'DIV', CLASS='system_message')) self.body.append('<H3>%s (level %s system message)</H3>\n' % (node['type'], node['level'])) --- 576,583 ---- def visit_system_message(self, node): ! if node['level'] < self.doctree.reporter.getcategory('output')[1]: ! # @@@ need another threshold? gotta fix that ! raise nodes.SkipNode ! self.body.append(self.starttag(node, 'div', CLASS='system_message')) self.body.append('<H3>%s (level %s system message)</H3>\n' % (node['type'], node['level'])) *************** *** 506,525 **** 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): --- 587,608 ---- def visit_table(self, node): ! self.body.append(self.starttag(node, 'table', rules='all')) def depart_table(self, node): ! self.body.append('</TABLE>\n') def visit_target(self, node): ! if not (node.has_key('refuri') or node.has_key('refid') ! or node.has_key('refname')): ! self.body.append(self.starttag(node, 'a', '')) def depart_target(self, node): ! self.body.append('</A>') def visit_tbody(self, node): ! self.body.append(self.starttag(node, 'tbody', valign='top')) def depart_tbody(self, node): ! self.body.append('</TBODY>\n') def visit_term(self, node): *************** *** 527,531 **** def depart_term(self, node): ! # leave the end tag to visit_definition, in case there's a classifier pass --- 610,617 ---- def depart_term(self, node): ! """ ! Leave the end tag to `self.visit_definition()`, in case there's a ! classifier. ! """ pass *************** *** 537,552 **** 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())) --- 623,639 ---- def visit_thead(self, node): ! self.body.append(self.starttag(node, 'thead', valign='bottom')) def depart_thead(self, node): ! self.body.append('</THEAD>\n') def visit_tip(self, node): ! self.visit_admonition(node, 'tip') def depart_tip(self, node): ! self.depart_admonition() def visit_title(self, node): + """Only 6 section levels are supported by HTML.""" if self.sectionlevel == 0: self.head.append('<TITLE>%s</TITLE>\n' % self.encode(node.astext())) *************** *** 554,558 **** else: self.body.append(self.starttag(node, 'H%s' % self.sectionlevel, '')) - # @@@ >H6? def depart_title(self, node): --- 641,644 ---- *************** *** 560,567 **** 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): --- 646,653 ---- self.body.append('</H1>\n') else: ! self.body.append('</H%s>\n' % self.sectionlevel) def visit_transition(self, node): ! self.body.append(self.starttag(node, 'hr')) def depart_transition(self, node): *************** *** 574,586 **** self.depart_docinfo_item() - 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 --- 660,666 ---- self.depart_docinfo_item() def visit_warning(self, node): ! self.visit_admonition(node, 'warning') def depart_warning(self, node): ! self.depart_admonition() |
From: David G. <go...@us...> - 2002-03-01 03:15:45
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv951/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.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** dps-notes.txt 20 Feb 2002 04:42:14 -0000 1.27 --- dps-notes.txt 1 Mar 2002 03:15:42 -0000 1.28 *************** *** 65,68 **** --- 65,72 ---- (SourceForge project registered & waiting.) + - Merge test directories. + - Remove complex import code. + - Rename gpdi.dtd to docutils.dtd. + - Provide a mechanism to pass options to Readers, Writers, and Parsers through dps.core.convert/Publisher? Or create custom |
From: David G. <go...@us...> - 2002-03-01 03:15:21
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv906/dps/spec Modified Files: gpdi.dtd Log Message: - Reworked option lists. Index: gpdi.dtd =================================================================== RCS file: /cvsroot/docstring/dps/spec/gpdi.dtd,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** gpdi.dtd 23 Feb 2002 16:49:54 -0000 1.34 --- gpdi.dtd 1 Mar 2002 03:15:18 -0000 1.35 *************** *** 262,266 **** prefix CDATA #IMPLIED suffix CDATA #IMPLIED ! start CDATA #IMPLIED> <!ELEMENT list_item (%body.elements;)+> --- 262,266 ---- prefix CDATA #IMPLIED suffix CDATA #IMPLIED ! start NUMBER #IMPLIED> <!ELEMENT list_item (%body.elements;)+> *************** *** 298,332 **** <!ATTLIST field_body %basic.atts;> - <!-- - `optarg_delimiter` contains the delimiter (either " " or "=") - consistently used by `long_option` and/or `vms_option` elements with - option arguments, or "mixed" if delimiter usage is mixed (both " " and - "=" used). If no such options exist, no `optarg_delimiter` attribute - will be present. `short_option` elements may only use spaces as - opt/arg delimiters; they don't affect the attribute. - --> <!ELEMENT option_list (option_list_item+)> ! <!ATTLIST option_list ! %basic.atts; ! optarg_delimiter CDATA #IMPLIED> ! <!ELEMENT option_list_item (option+, description)> <!ATTLIST option_list_item %basic.atts;> ! <!ELEMENT option ! ((short_option | long_option | vms_option), option_argument?)> ! <!ATTLIST option %basic.atts;> ! ! <!ELEMENT short_option (#PCDATA)> ! <!ATTLIST short_option %basic.atts;> ! <!ELEMENT long_option (#PCDATA)> ! <!ATTLIST long_option %basic.atts;> ! <!ELEMENT vms_option (#PCDATA)> ! <!ATTLIST vms_option %basic.atts;> <!ELEMENT option_argument (#PCDATA)> ! <!ATTLIST option_argument %basic.atts;> <!ELEMENT description (%body.elements;)+> --- 298,326 ---- <!ATTLIST field_body %basic.atts;> <!ELEMENT option_list (option_list_item+)> ! <!ATTLIST option_list %basic.atts;> ! <!ELEMENT option_list_item (option_group, description)> <!ATTLIST option_list_item %basic.atts;> ! <!ELEMENT option_group (option+)> ! <!ATTLIST option_group %basic.atts;> ! <!ELEMENT option (option_string, option_argument*)> ! <!ATTLIST option %basic.atts;> ! <!ELEMENT option_string (#PCDATA)> ! <!ATTLIST option_string %basic.atts;> + <!-- + `delimiter` contains the string preceding the `option_argument`: + either the string separating it from the `option` (typically either + "=" or " ") or the string between option arguments (typically either + "," or " "). + --> <!ELEMENT option_argument (#PCDATA)> ! <!ATTLIST option_argument ! %basic.atts; ! delimiter CDATA #IMPLIED> <!ELEMENT description (%body.elements;)+> |
From: David G. <go...@us...> - 2002-03-01 03:14:38
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv722/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.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_docinfo.py 22 Feb 2002 01:57:22 -0000 1.7 --- test_docinfo.py 1 Mar 2002 03:14:36 -0000 1.8 *************** *** 246,250 **** Authors <field_body> ! <enumerated_list enumtype="arabic" prefix="" start="1" suffix="."> <list_item> <paragraph> --- 246,250 ---- Authors <field_body> ! <enumerated_list enumtype="arabic" prefix="" suffix="."> <list_item> <paragraph> |
From: David G. <go...@us...> - 2002-03-01 03:13:40
|
Update of /cvsroot/docstring/dps/dps/transforms In directory usw-pr-cvs1:/tmp/cvs-serv421/dps/dps/transforms Added Files: universal.py Log Message: Transforms needed by most or all documents --- NEW FILE: universal.py --- #! /usr/bin/env python """ :Authors: David Goodger, Ueli Schlaepfer :Contact: go...@us... :Revision: $Revision: 1.1 $ :Date: $Date: 2002/03/01 03:13:37 $ :Copyright: This module has been placed in the public domain. Transforms needed by most or all documents: - `Messages`: Placement of system messages stored in `nodes.document.messages`. """ __docformat__ = 'reStructuredText' import re from dps import nodes, utils from dps.transforms import TransformError, Transform class Messages(Transform): """ Place any system messages generated after parsing into a dedicated section of the document. """ def transform(self, doctree): self.setup_transform(doctree) if len(doctree.messages) > 0: section = nodes.section(CLASS='system_messages') # @@@ get this from the language module? section += nodes.title('', 'Docutils System Messages') section += doctree.messages.getchildren() doctree += section class TestMessages(Transform): """ Append all system messages to the end of the doctree. """ def transform(self, doctree): self.setup_transform(doctree) doctree += doctree.messages.getchildren() test_transforms = (TestMessages,) """Tuple of universal transforms to apply to the raw doctree when testing.""" first_reader_transforms = () """Tuple of universal transforms to apply before any other Reader transforms.""" last_reader_transforms = (Messages,) """Tuple of universal transforms to apply after all other Reader transforms.""" first_writer_transforms = () """Tuple of universal transforms to apply before any other Writer transforms.""" last_writer_transforms = () """Tuple of universal transforms to apply after all other Writer transforms.""" |
From: David G. <go...@us...> - 2002-02-23 16:54:26
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv9303/dps Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** HISTORY.txt 22 Feb 2002 02:13:27 -0000 1.41 --- HISTORY.txt 23 Feb 2002 16:54:23 -0000 1.42 *************** *** 153,156 **** --- 153,158 ---- support). - Removed Python-specific interpreted text mapping. + - Changed 'bibliographic_labels' to 'labels'. + - Added labels for admonitions. * dps/transforms: Subpackage added. Thanks to Ueli Schlaepfer for the *************** *** 190,193 **** --- 192,196 ---- - Added option_list and doctest_block from ppdi.dtd. - Added vms_option element to option. + - Added support for 'option_list' attribute 'optarg_delimiter'. - Added classifier element to definition_list_item. - Added dupname attribute to %basic.atts; for duplicate names. |
From: David G. <go...@us...> - 2002-02-23 16:53:33
|
Update of /cvsroot/docstring/dps/dps/languages In directory usw-pr-cvs1:/tmp/cvs-serv9044/dps/dps/languages Modified Files: en.py Log Message: - Changed 'bibliographic_labels' to 'labels'. - Added labels for admonitions. Index: en.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/languages/en.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** en.py 6 Feb 2002 02:41:54 -0000 1.7 --- en.py 23 Feb 2002 16:53:30 -0000 1.8 *************** *** 14,18 **** __docformat__ = 'reStructuredText' ! __all__ = ['bibliographic_labels', 'bibliographic_fields', 'author_separators'] --- 14,18 ---- __docformat__ = 'reStructuredText' ! __all__ = ['labels', 'bibliographic_fields', 'author_separators'] *************** *** 20,24 **** ! bibliographic_labels = { 'author': 'Author', 'authors': 'Authors', --- 20,24 ---- ! labels = { 'author': 'Author', 'authors': 'Authors', *************** *** 30,35 **** 'date': 'Date', 'copyright': 'Copyright', ! 'abstract': 'Abstract'} ! """Mapping of bibliographic node class name to label text.""" bibliographic_fields = { --- 30,45 ---- 'date': 'Date', 'copyright': 'Copyright', ! 'abstract': 'Abstract', ! 'attention': 'Attention!', ! 'caution': 'Caution!', ! 'danger': '!DANGER!', ! 'error': 'Error', ! 'hint': 'Hint', ! 'important': 'Important', ! 'note': 'Note', ! 'tip': 'Tip', ! 'warning': 'Warning', ! } ! """Mapping of node class name to label text.""" bibliographic_fields = { |
From: David G. <go...@us...> - 2002-02-23 16:51:34
|
Update of /cvsroot/docstring/dps/dps/writers In directory usw-pr-cvs1:/tmp/cvs-serv8636/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.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** html.py 22 Feb 2002 01:59:22 -0000 1.3 --- html.py 23 Feb 2002 16:51:31 -0000 1.4 *************** *** 42,46 **** 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, --- 42,46 ---- nodes.NodeVisitor.__init__(self, doctree) self.language = languages.getlanguage(doctree.languagecode) ! self.head = ['<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"\n' ' "http://www.w3.org/TR/html4/strict.dtd">\n', '<HTML LANG="%s">\n<HEAD>\n' % doctree.languagecode, *************** *** 88,111 **** 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): ! pass def depart_attention(self, node): ! pass def visit_author(self, node): ! self.head.append(self.starttag(node, 'meta', name='author', ! content=node.astext())) def depart_author(self, node): ! pass def visit_authors(self, node): --- 88,114 ---- def visit_abstract(self, node): ! self.visit_admonition(node, 'abstract') def depart_abstract(self, node): + self.depart_admonition() + + def visit_admonition(self, node, name): + self.body.append(self.starttag(node, 'div', CLASS=name)) + self.body.append('<H3>' + self.language.labels[name] + '</H3>\n') + + def depart_admonition(self): self.body.append('</DIV>\n') def visit_attention(self, node): ! self.visit_admonition(node, 'attention') def depart_attention(self, node): ! self.depart_admonition() def visit_author(self, node): ! self.visit_docinfo_item(node, 'author') def depart_author(self, node): ! self.depart_docinfo_item() def visit_authors(self, node): *************** *** 160,174 **** 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())) def depart_copyright(self, node): ! pass def visit_danger(self, node): --- 163,176 ---- def visit_contact(self, node): ! self.visit_docinfo_item(node, 'contact') def depart_contact(self, node): ! self.depart_docinfo_item() def visit_copyright(self, node): ! self.visit_docinfo_item(node, 'copyright') def depart_copyright(self, node): ! self.depart_docinfo_item() def visit_danger(self, node): *************** *** 179,187 **** def visit_date(self, node): ! self.head.append(self.starttag(node, 'meta', name='date', ! content=node.astext())) def depart_date(self, node): ! pass def visit_definition(self, node): --- 181,188 ---- def visit_date(self, node): ! self.visit_docinfo_item(node, 'date') def depart_date(self, node): ! self.depart_docinfo_item() def visit_definition(self, node): *************** *** 211,219 **** def visit_docinfo(self, node): - # @@@ as a table? self.body.append(self.starttag(node, 'DIV', CLASS='docinfo')) def depart_docinfo(self, node): ! self.body.append('</DIV>\n') def visit_doctest_block(self, node): --- 212,234 ---- def visit_docinfo(self, node): self.body.append(self.starttag(node, 'DIV', CLASS='docinfo')) + self.body.append('<TABLE FRAME="void" RULES="none">\n' + '<COL CLASS="docinfo_name">\n' + '<COL CLASS="docinfo_content">\n' + '<TBODY VALIGN="top">\n') def depart_docinfo(self, node): ! self.body.append('</TABLE>\n</TBODY>\n</DIV>\n') ! ! def visit_docinfo_item(self, node, name): ! self.head.append(self.starttag(node, 'meta', name=name, ! content=node.astext())) ! self.body.append('<TR><TD>\n' ! '<P>%s:</P>\n' ! '</TD><TD>\n' ! '<P>' % self.language.labels[name]) ! ! def depart_docinfo_item(self): ! self.body.append('</P></TD>\n</TR>\n') def visit_doctest_block(self, node): *************** *** 403,410 **** def visit_organization(self, node): ! pass def depart_organization(self, node): ! pass def visit_paragraph(self, node): --- 418,425 ---- def visit_organization(self, node): ! self.visit_docinfo_item(node, 'organization') def depart_organization(self, node): ! self.depart_docinfo_item() def visit_paragraph(self, node): *************** *** 427,434 **** def visit_revision(self, node): ! pass def depart_revision(self, node): ! pass def visit_row(self, node): --- 442,449 ---- def visit_revision(self, node): ! self.visit_docinfo_item(node, 'revision') def depart_revision(self, node): ! self.depart_docinfo_item() def visit_row(self, node): *************** *** 453,460 **** def visit_status(self, node): ! pass def depart_status(self, node): ! pass def visit_strong(self, node): --- 468,475 ---- def visit_status(self, node): ! self.visit_docinfo_item(node, 'status') def depart_status(self, node): ! self.depart_docinfo_item() def visit_strong(self, node): *************** *** 484,488 **** def visit_system_message(self, node): self.body.append(self.starttag(node, 'DIV', CLASS='system_message')) ! self.body.append('<H3>%s (%s)</H3>\n' % (node['type'], node['level'])) def depart_system_message(self, node): --- 499,504 ---- def visit_system_message(self, node): self.body.append(self.starttag(node, 'DIV', CLASS='system_message')) ! self.body.append('<H3>%s (level %s system message)</H3>\n' ! % (node['type'], node['level'])) def depart_system_message(self, node): *************** *** 553,560 **** def visit_version(self, node): ! pass def depart_version(self, node): ! pass def visit_vms_option(self, node): --- 569,576 ---- def visit_version(self, node): ! self.visit_docinfo_item(node, 'version') def depart_version(self, node): ! self.depart_docinfo_item() def visit_vms_option(self, node): |
From: David G. <go...@us...> - 2002-02-23 16:49:57
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv8202/dps/spec Modified Files: gpdi.dtd Log Message: - Added support for 'option_list' attribute 'optarg_delimiter'. Index: gpdi.dtd =================================================================== RCS file: /cvsroot/docstring/dps/spec/gpdi.dtd,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** gpdi.dtd 22 Feb 2002 01:53:48 -0000 1.33 --- gpdi.dtd 23 Feb 2002 16:49:54 -0000 1.34 *************** *** 114,119 **** | bullet_list | enumerated_list | definition_list | field_list | option_list ! | note | tip | hint | warning | error | caution | danger ! | important | target | substitution_definition | comment | system_message %additional.body.elements; "> --- 114,119 ---- | bullet_list | enumerated_list | definition_list | field_list | option_list ! | note | tip | hint | warning | error | attention | caution ! | danger | important | target | substitution_definition | comment | system_message %additional.body.elements; "> *************** *** 298,303 **** <!ATTLIST field_body %basic.atts;> <!ELEMENT option_list (option_list_item+)> ! <!ATTLIST option_list %basic.atts;> <!ELEMENT option_list_item (option+, description)> --- 298,313 ---- <!ATTLIST field_body %basic.atts;> + <!-- + `optarg_delimiter` contains the delimiter (either " " or "=") + consistently used by `long_option` and/or `vms_option` elements with + option arguments, or "mixed" if delimiter usage is mixed (both " " and + "=" used). If no such options exist, no `optarg_delimiter` attribute + will be present. `short_option` elements may only use spaces as + opt/arg delimiters; they don't affect the attribute. + --> <!ELEMENT option_list (option_list_item+)> ! <!ATTLIST option_list ! %basic.atts; ! optarg_delimiter CDATA #IMPLIED> <!ELEMENT option_list_item (option+, description)> |
From: David G. <go...@us...> - 2002-02-22 02:13:30
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv3089/dps Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** HISTORY.txt 20 Feb 2002 04:18:25 -0000 1.40 --- HISTORY.txt 22 Feb 2002 02:13:27 -0000 1.41 *************** *** 18,26 **** David Ascher, Fred Drake, Jim Fulton, Peter Funk, Doug Hellmann, ! Juergen Hermann, Tony Ibbs, Garth Kidd, Daniel Larsson, Marc-Andre ! Lemburg, Wolfgang Lipp, Edward Loper, Ken Manheimer, Paul Moore, ! Michel Pelletier, Sam Penrose, Tim Peters, Mark Pilgrim, Tavis ! Rudd, Ueli Schlaepfer, Bob Tolbert, Laurence Tratt, Guido van ! Rossum, Barry Warsaw, Edward Welbourne, Ka-Ping Yee, Moshe Zadka (I'm still waiting for contributions of tasty snacks, computer --- 18,27 ---- David Ascher, Fred Drake, Jim Fulton, Peter Funk, Doug Hellmann, ! Juergen Hermann, Tony Ibbs, Richard Jones, Garth Kidd, Daniel ! Larsson, Marc-Andre Lemburg, Wolfgang Lipp, Edward Loper, Ken ! Manheimer, Paul Moore, Michel Pelletier, Sam Penrose, Tim Peters, ! Mark Pilgrim, Tavis Rudd, Ueli Schlaepfer, Bob Tolbert, Laurence ! Tratt, Guido van Rossum, Barry Warsaw, Edward Welbourne, Ka-Ping ! Yee, Moshe Zadka (I'm still waiting for contributions of tasty snacks, computer *************** *** 89,92 **** --- 90,94 ---- - Simplified target record keeping. - Changed "system_warning" to "system_message". + - Modified post-parse system message storage. - Added 'id' attribute support to ``document``. *************** *** 194,202 **** column span indication. - Made document subtitle dependent on the existence of a title. - - Moved 'abstract' into the bibliographic elements section. - Changed 'graphic' to 'image'. - Moved 'caption' to after 'image' in 'figure'. - Added 'error' and 'hint' admonition elements. - Added 'docinfo' as container for bibliographic elements. - Added 'transition'. - Changed %link.atts to %reference.atts. --- 196,204 ---- column span indication. - Made document subtitle dependent on the existence of a title. - Changed 'graphic' to 'image'. - Moved 'caption' to after 'image' in 'figure'. - Added 'error' and 'hint' admonition elements. - Added 'docinfo' as container for bibliographic elements. + - Made 'abstract' a structural element, after 'docinfo'. - Added 'transition'. - Changed %link.atts to %reference.atts. |
From: David G. <go...@us...> - 2002-02-22 02:11:27
|
Update of /cvsroot/docstring/dps/dps/transforms In directory usw-pr-cvs1:/tmp/cvs-serv1888/dps/dps/transforms Modified Files: references.py Log Message: - Modified post-parse system message storage. Index: references.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/transforms/references.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** references.py 20 Feb 2002 04:14:15 -0000 1.6 --- references.py 22 Feb 2002 02:11:24 -0000 1.7 *************** *** 130,138 **** if len(self.doctree.anonymous_refs) \ != len(self.doctree.anonymous_targets): ! sw = self.doctree.reporter.error( 'Anonymous hyperlink mismatch: %s references but %s targets.' % (len(self.doctree.anonymous_refs), len(self.doctree.anonymous_targets))) ! self.doctree += sw return for i in range(len(self.doctree.anonymous_refs)): --- 130,138 ---- if len(self.doctree.anonymous_refs) \ != len(self.doctree.anonymous_targets): ! msg = self.doctree.reporter.error( 'Anonymous hyperlink mismatch: %s references but %s targets.' % (len(self.doctree.anonymous_refs), len(self.doctree.anonymous_targets))) ! self.doctree.messages += msg return for i in range(len(self.doctree.anonymous_refs)): *************** *** 170,177 **** reftarget = self.doctree.explicit_targets[refname] except KeyError: ! sw = self.doctree.reporter.warning( 'Indirect hyperlink target "%s" refers to target "%s", ' 'which does not exist.' % (name, refname)) ! self.doctree += sw if reftarget.hasattr('name'): if not reftarget.resolved and reftarget.hasattr('refname'): --- 170,177 ---- reftarget = self.doctree.explicit_targets[refname] except KeyError: ! msg = self.doctree.reporter.warning( 'Indirect hyperlink target "%s" refers to target "%s", ' 'which does not exist.' % (name, refname)) ! self.doctree.messages += msg if reftarget.hasattr('name'): if not reftarget.resolved and reftarget.hasattr('refname'): *************** *** 189,196 **** reflist = self.doctree.refnames[name] except KeyError, instance: ! sw = self.doctree.reporter.info( 'Indirect hyperlink target "%s" is not referenced.' % name) ! self.doctree += sw return for ref in self.doctree.refnames[name]: --- 189,196 ---- reflist = self.doctree.refnames[name] except KeyError, instance: ! msg = self.doctree.reporter.info( 'Indirect hyperlink target "%s" is not referenced.' % name) ! self.doctree.messages += msg return for ref in self.doctree.refnames[name]: *************** *** 200,207 **** ref['refname'] = refname except KeyError, instance: ! sw = self.doctree.reporter.error( 'Indirect hyperlink target "%s" has no "refname" ' 'attribute.' % name) ! self.doctree += sw continue ref.resolved = 1 --- 200,207 ---- ref['refname'] = refname except KeyError, instance: ! msg = self.doctree.reporter.error( 'Indirect hyperlink target "%s" has no "refname" ' 'attribute.' % name) ! self.doctree.messages += msg continue ref.resolved = 1 *************** *** 218,224 **** reflist = self.doctree.refnames[name] except KeyError, instance: ! sw = self.doctree.reporter.info( 'External hyperlink target "%s" is not referenced.' % name) ! self.doctree += sw return for ref in self.doctree.refnames[name]: --- 218,224 ---- reflist = self.doctree.refnames[name] except KeyError, instance: ! msg = self.doctree.reporter.info( 'External hyperlink target "%s" is not referenced.' % name) ! self.doctree.messages += msg return for ref in self.doctree.refnames[name]: *************** *** 228,235 **** ref['refuri'] = refuri except KeyError, instance: ! sw = self.doctree.reporter.error( 'External hyperlink target "%s" has no "refuri" ' 'attribute.' % name) ! self.doctree += sw continue del ref['refname'] --- 228,235 ---- ref['refuri'] = refuri except KeyError, instance: ! msg = self.doctree.reporter.error( 'External hyperlink target "%s" has no "refuri" ' 'attribute.' % name) ! self.doctree.messages += msg continue del ref['refname'] *************** *** 406,414 **** ref['refname'] = self.autofootnote_labels[i] except IndexError: ! sw = self.doctree.reporter.error( 'Too many autonumbered footnote references: only %s ' 'corresponding footnotes available.' % len(self.autofootnote_labels)) ! self.doctree += sw break ref.resolved = 1 --- 406,414 ---- ref['refname'] = self.autofootnote_labels[i] except IndexError: ! msg = self.doctree.reporter.error( 'Too many autonumbered footnote references: only %s ' 'corresponding footnotes available.' % len(self.autofootnote_labels)) ! self.doctree.messages += msg break ref.resolved = 1 *************** *** 455,461 **** ref.parent.replace(ref, defs[refname].getchildren()) else: ! sw = self.doctree.reporter.error( 'Undefined substitution referenced: "%s".' % refname) ! self.doctree += sw ref.parent.replace(ref, nodes.problematic( ref.rawsource, '', *ref.getchildren())) --- 455,461 ---- ref.parent.replace(ref, defs[refname].getchildren()) else: ! msg = self.doctree.reporter.error( 'Undefined substitution referenced: "%s".' % refname) ! self.doctree.messages += msg ref.parent.replace(ref, nodes.problematic( ref.rawsource, '', *ref.getchildren())) |
From: David G. <go...@us...> - 2002-02-22 02:11:18
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv1821/dps/dps Modified Files: nodes.py Log Message: - Modified post-parse system message storage. Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** nodes.py 21 Feb 2002 03:44:53 -0000 1.31 --- nodes.py 22 Feb 2002 02:11:14 -0000 1.32 *************** *** 179,185 **** self.extend(children) # extend self.children w/ attributes ! self.attributes = attributes """Dictionary of attribute {name: value}.""" if self.tagname is None: self.tagname = self.__class__.__name__ --- 179,188 ---- self.extend(children) # extend self.children w/ attributes ! self.attributes = {} """Dictionary of attribute {name: value}.""" + for att, value in attributes.items(): + self.attributes[att.lower()] = value + if self.tagname is None: self.tagname = self.__class__.__name__ *************** *** 540,543 **** --- 543,549 ---- """Initial ID number.""" + self.messages = Element() + """System messages generated after parsing.""" + def asdom(self, dom=xml.dom.minidom): domroot = dom.Document() *************** *** 545,556 **** 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: --- 551,562 ---- return domroot ! def set_id(self, node, msgnode=None): ! if msgnode == None: ! msgnode = self.messages 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) ! msgnode += msg else: while 1: *************** *** 568,593 **** '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) \ or self.external_targets.has_key(name) \ or self.implicit_targets.has_key(name): ! 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) del targetnode['name'] targetnode['dupname'] = name self.implicit_targets[name] = targetnode ! self.set_id(targetnode) ! def note_explicit_target(self, targetnode, innode=None): ! if innode == None: ! innode = self name = targetnode['name'] if self.explicit_targets.has_key(name): --- 574,599 ---- 'Multiple IDs for name "%s": "%s", "%s"' % (name, self.nameids[name], id)) ! msgnode += msg self.nameids[name] = id ! def note_implicit_target(self, targetnode, msgnode=None): ! if msgnode == None: ! msgnode = self.messages name = targetnode['name'] if self.explicit_targets.has_key(name) \ or self.external_targets.has_key(name) \ or self.implicit_targets.has_key(name): ! msg = self.reporter.info( 'Duplicate implicit target name: "%s"' % name) ! msgnode += msg self.clear_target_names(name, self.implicit_targets) del targetnode['name'] targetnode['dupname'] = name self.implicit_targets[name] = targetnode ! self.set_id(targetnode, msgnode) ! def note_explicit_target(self, targetnode, msgnode=None): ! if msgnode == None: ! msgnode = self.messages name = targetnode['name'] if self.explicit_targets.has_key(name): *************** *** 599,605 **** 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 self.clear_target_names(name, self.explicit_targets, self.implicit_targets) --- 605,611 ---- and t['refuri'] == refuri: level = 1 # just inform if refuri's identical ! msg = self.reporter.system_message( level, 'Duplicate explicit target name: "%s"' % name) ! msgnode += msg self.clear_target_names(name, self.explicit_targets, self.implicit_targets) *************** *** 608,617 **** targetnode['dupname'] = name elif self.implicit_targets.has_key(name): ! sw = self.reporter.info( 'Duplicate implicit target name: "%s"' % name) ! innode += sw self.clear_target_names(name, self.implicit_targets) self.explicit_targets[name] = targetnode ! self.set_id(targetnode) def clear_target_names(self, name, *targetdicts): --- 614,623 ---- targetnode['dupname'] = name elif self.implicit_targets.has_key(name): ! msg = self.reporter.info( 'Duplicate implicit target name: "%s"' % name) ! msgnode += msg self.clear_target_names(name, self.implicit_targets) self.explicit_targets[name] = targetnode ! self.set_id(targetnode, msgnode) def clear_target_names(self, name, *targetdicts): *************** *** 650,661 **** self.note_refname(refnode) ! 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] oldnode['dupname'] = oldnode['name'] --- 656,667 ---- self.note_refname(refnode) ! def note_substitution_def(self, substitutiondefnode, msgnode=None): name = substitutiondefnode['name'] if self.substitution_defs.has_key(name): ! msg = self.reporter.error( 'Duplicate substitution definition name: "%s"' % name) ! if msgnode == None: ! msgnode = self.messages ! msgnode += msg oldnode = self.substitution_defs[name] oldnode['dupname'] = oldnode['name'] |
From: David G. <go...@us...> - 2002-02-22 02:08:37
|
Update of /cvsroot/docstring/dps/dps/transforms In directory usw-pr-cvs1:/tmp/cvs-serv32681/dps/dps/transforms Modified Files: frontmatter.py Log Message: Updated for abstract; untabified. Index: frontmatter.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/transforms/frontmatter.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** frontmatter.py 12 Feb 2002 02:17:56 -0000 1.4 --- frontmatter.py 22 Feb 2002 02:08:34 -0000 1.5 *************** *** 28,105 **** """ ! In reStructuredText_, there is no way to specify a document title ! and subtitle explicitly. Instead, we can supply the document title ! (and possibly the subtitle as well) implicitly, and use this ! two-step transform to "raise" or "promote" the title(s) (and their ! corresponding section contents) to the document level. ! 1. If the document contains a single top-level section as its ! first non-comment element, the top-level section's title ! becomes the document's title, and the top-level section's ! contents become the document's immediate contents. The lone ! top-level section header must be the first non-comment element ! in the document. ! For example, take this input text:: ! ================= ! Top-Level Title ! ================= ! A paragraph. ! Once parsed, it looks like this:: ! <document> ! <section name="top-level title"> ! <title> ! Top-Level Title ! <paragraph> ! A paragraph. ! After running the DocTitle transform, we have:: ! <document name="top-level title"> ! <title> ! Top-Level Title ! <paragraph> ! A paragraph. ! 2. If step 1 successfully determines the document title, we ! continue by checking for a subtitle. ! If the lone top-level section itself contains a single ! second-level section as its first non-comment element, that ! section's title is promoted to the document's subtitle, and ! that section's contents become the document's immediate ! contents. Given this input text:: ! ================= ! Top-Level Title ! ================= ! Second-Level Title ! ~~~~~~~~~~~~~~~~~~ ! A paragraph. ! After parsing and running the Section Promotion transform, the ! result is:: ! <document name="top-level title"> ! <title> ! Top-Level Title ! <subtitle name="second-level title"> ! Second-Level Title ! <paragraph> ! A paragraph. ! (Note that the implicit hyperlink target generated by the ! "Second-Level Title" is preserved on the "subtitle" element ! itself.) ! Any comment elements occurring before the document title or ! subtitle are accumulated and inserted as the first body elements ! after the title(s). """ --- 28,105 ---- """ ! In reStructuredText_, there is no way to specify a document title ! and subtitle explicitly. Instead, we can supply the document title ! (and possibly the subtitle as well) implicitly, and use this ! two-step transform to "raise" or "promote" the title(s) (and their ! corresponding section contents) to the document level. ! 1. If the document contains a single top-level section as its ! first non-comment element, the top-level section's title ! becomes the document's title, and the top-level section's ! contents become the document's immediate contents. The lone ! top-level section header must be the first non-comment element ! in the document. ! For example, take this input text:: ! ================= ! Top-Level Title ! ================= ! A paragraph. ! Once parsed, it looks like this:: ! <document> ! <section name="top-level title"> ! <title> ! Top-Level Title ! <paragraph> ! A paragraph. ! After running the DocTitle transform, we have:: ! <document name="top-level title"> ! <title> ! Top-Level Title ! <paragraph> ! A paragraph. ! 2. If step 1 successfully determines the document title, we ! continue by checking for a subtitle. ! If the lone top-level section itself contains a single ! second-level section as its first non-comment element, that ! section's title is promoted to the document's subtitle, and ! that section's contents become the document's immediate ! contents. Given this input text:: ! ================= ! Top-Level Title ! ================= ! Second-Level Title ! ~~~~~~~~~~~~~~~~~~ ! A paragraph. ! After parsing and running the Section Promotion transform, the ! result is:: ! <document name="top-level title"> ! <title> ! Top-Level Title ! <subtitle name="second-level title"> ! Second-Level Title ! <paragraph> ! A paragraph. ! (Note that the implicit hyperlink target generated by the ! "Second-Level Title" is preserved on the "subtitle" element ! itself.) ! Any comment elements occurring before the document title or ! subtitle are accumulated and inserted as the first body elements ! after the title(s). """ *************** *** 157,225 **** """ ! This transform is specific to the reStructuredText_ markup syntax; ! see "Bibliographic Fields" in the `reStructuredText Markup ! Specification`_ for a high-level description. This transform ! should be run *after* the `DocTitle` transform. ! Given a field list as the first non-comment element after the ! document title and subtitle (if present), registered bibliographic ! field names are transformed to the corresponding DTD elements, ! becoming child elements of the "docinfo" element. ! For example, given this document fragment after parsing:: ! <document> ! <title> ! Document Title ! <field_list> ! <field> ! <field_name> ! Author ! <field_body> ! <paragraph> ! Kilgore Trout ! <field> ! <field_name> ! Status ! <field_body> ! <paragraph> ! $RCSfile$ ! ... ! After running the bibliographic field list transform, the ! resulting document tree would look like this:: ! <document> ! <title> ! Document Title ! <docinfo> ! <author> ! Kilgore Trout ! <status> ! frontmatter.py ! ... ! The "Status" field contained an expanded RCS keyword, which is ! normally (but optionally) cleaned up by the transform. The sole ! contents of the field body must be a paragraph containing an ! expanded RCS keyword of the form "$keyword: expansion text $". Any ! RCS keyword can be processed in any bibliographic field. The ! dollar signs and leading RCS keyword name are removed. Extra ! processing is done for the following RCS keywords: ! - "RCSfile" expands to the name of the file in the RCS or CVS ! repository, which is the name of the source file with a ",v" ! suffix appended. The transform will remove the ",v" suffix. ! - "Date" expands to the format "YYYY/MM/DD hh:mm:ss" (in the UTC ! time zone). The RCS Keywords transform will extract just the ! date itself and transform it to an ISO 8601 format date, as in ! "2000-12-31". ! (Since the source file for this text is itself stored under CVS, ! we can't show an example of the "Date" RCS keyword because we ! can't prevent any RCS keywords used in this explanation from ! being expanded. Only the "RCSfile" keyword is stable; its ! expansion text changes only if the file name changes.) """ --- 157,226 ---- """ ! This transform is specific to the reStructuredText_ markup syntax; ! see "Bibliographic Fields" in the `reStructuredText Markup ! Specification`_ for a high-level description. This transform ! should be run *after* the `DocTitle` transform. ! Given a field list as the first non-comment element after the ! document title and subtitle (if present), registered bibliographic ! field names are transformed to the corresponding DTD elements, ! becoming child elements of the "docinfo" element (except for the ! "abstract" element, which comes after "docinfo"). ! For example, given this document fragment after parsing:: ! <document> ! <title> ! Document Title ! <field_list> ! <field> ! <field_name> ! Author ! <field_body> ! <paragraph> ! Kilgore Trout ! <field> ! <field_name> ! Status ! <field_body> ! <paragraph> ! $RCSfile$ ! ... ! After running the bibliographic field list transform, the ! resulting document tree would look like this:: ! <document> ! <title> ! Document Title ! <docinfo> ! <author> ! Kilgore Trout ! <status> ! frontmatter.py ! ... ! The "Status" field contained an expanded RCS keyword, which is ! normally (but optionally) cleaned up by the transform. The sole ! contents of the field body must be a paragraph containing an ! expanded RCS keyword of the form "$keyword: expansion text $". Any ! RCS keyword can be processed in any bibliographic field. The ! dollar signs and leading RCS keyword name are removed. Extra ! processing is done for the following RCS keywords: ! - "RCSfile" expands to the name of the file in the RCS or CVS ! repository, which is the name of the source file with a ",v" ! suffix appended. The transform will remove the ",v" suffix. ! - "Date" expands to the format "YYYY/MM/DD hh:mm:ss" (in the UTC ! time zone). The RCS Keywords transform will extract just the ! date itself and transform it to an ISO 8601 format date, as in ! "2000-12-31". ! (Since the source file for this text is itself stored under CVS, ! we can't show an example of the "Date" RCS keyword because we ! can't prevent any RCS keywords used in this explanation from ! being expanded. Only the "RCSfile" keyword is stable; its ! expansion text changes only if the file name changes.) """ *************** *** 276,288 **** remainder.append(field) continue if abstract: ! docinfo.append(abstract) ! if len(docinfo) == 0: ! return [], field_list if remainder: field_list[:] = remainder else: field_list = None ! return [docinfo], field_list def check_empty_biblio_field(self, field, name): --- 277,290 ---- remainder.append(field) continue + nodelist = [] + if len(docinfo) != 0: + nodelist.append(docinfo) if abstract: ! nodelist.append(abstract) if remainder: field_list[:] = remainder else: field_list = None ! return nodelist, field_list def check_empty_biblio_field(self, field, name): |
From: David G. <go...@us...> - 2002-02-22 02:08:03
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv29304/dps/dps Modified Files: utils.py Log Message: 'sw' -> 'msg' Index: utils.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/utils.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** utils.py 15 Feb 2002 22:42:44 -0000 1.15 --- utils.py 22 Feb 2002 02:02:57 -0000 1.16 *************** *** 98,112 **** 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) if level >= warninglevel or debug and level == 0: if category: ! print >>stream, 'Reporter "%s":' % category, sw.astext() else: ! print >>stream, 'Reporter:', sw.astext() if level >= errorlevel: ! raise SystemMessage(sw) ! return sw def debug(self, comment=None, children=[], category=''): --- 98,112 ---- Raise an exception or generate a warning if appropriate. """ ! msg = nodes.system_message(comment, level=level, ! type=self.levels[level], *children) debug, warninglevel, errorlevel, stream = self.getcategory(category) if level >= warninglevel or debug and level == 0: if category: ! print >>stream, 'Reporter "%s":' % category, msg.astext() else: ! print >>stream, 'Reporter:', msg.astext() if level >= errorlevel: ! raise SystemMessage(msg) ! return msg def debug(self, comment=None, children=[], category=''): |
From: David G. <go...@us...> - 2002-02-22 02:01:15
|
Update of /cvsroot/docstring/dps/dps/writers In directory usw-pr-cvs1:/tmp/cvs-serv28197/dps/dps/writers Modified Files: __init__.py Log Message: - Added support for universal transforms. Index: __init__.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/writers/__init__.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** __init__.py 20 Feb 2002 04:14:52 -0000 1.4 --- __init__.py 22 Feb 2002 02:01:11 -0000 1.5 *************** *** 16,21 **** - from dps import languages import sys --- 16,22 ---- import sys + from dps import languages + from dps.transforms import universal *************** *** 57,61 **** def transform(self): """Run all of the transforms defined for this Writer.""" ! for xclass in self.transforms: xclass().transform(self.document) --- 58,64 ---- def transform(self): """Run all of the transforms defined for this Writer.""" ! for xclass in (universal.first_writer_transforms ! + tuple(self.transforms) ! + universal.last_writer_transforms): xclass().transform(self.document) |
From: David G. <go...@us...> - 2002-02-22 02:01:04
|
Update of /cvsroot/docstring/dps/dps/readers In directory usw-pr-cvs1:/tmp/cvs-serv28039/dps/dps/readers Modified Files: __init__.py Log Message: - Added support for universal transforms. Index: __init__.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/readers/__init__.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** __init__.py 12 Feb 2002 02:19:27 -0000 1.3 --- __init__.py 22 Feb 2002 02:01:02 -0000 1.4 *************** *** 18,21 **** --- 18,22 ---- import sys from dps import nodes, utils + from dps.transforms import universal *************** *** 30,34 **** transforms = () ! """Ordered list of transform classes (each with a ``transform()`` method). Populated by subclasses. `Reader.transform()` instantiates & runs them.""" --- 31,35 ---- transforms = () ! """Ordered tuple of transform classes (each with a ``transform()`` method). Populated by subclasses. `Reader.transform()` instantiates & runs them.""" *************** *** 54,58 **** a collection of strings.""" ! self.transforms = list(self.transforms) """Instance copy of `Reader.transforms`; may be modified by client.""" --- 55,59 ---- a collection of strings.""" ! self.transforms = tuple(self.transforms) """Instance copy of `Reader.transforms`; may be modified by client.""" *************** *** 92,96 **** def transform(self): """Run all of the transforms defined for this Reader.""" ! for xclass in self.transforms: xclass().transform(self.document) --- 93,99 ---- def transform(self): """Run all of the transforms defined for this Reader.""" ! for xclass in (universal.first_reader_transforms ! + tuple(self.transforms) ! + universal.last_reader_transforms): xclass().transform(self.document) |
From: David G. <go...@us...> - 2002-02-22 01:59:25
|
Update of /cvsroot/docstring/dps/dps/writers In directory usw-pr-cvs1:/tmp/cvs-serv26888/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.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** html.py 21 Feb 2002 03:41:31 -0000 1.2 --- html.py 22 Feb 2002 01:59:22 -0000 1.3 *************** *** 62,74 **** return text ! def starttag(self, node, tagname, suffix='\n', **attrs): ! attlist = attrs.items() ! for att in ('id', 'class'): if node.has_key(att): ! 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) --- 62,82 ---- return text ! def starttag(self, node, tagname, suffix='\n', **attributes): ! attrs = {} ! for (name, value) in attributes.items(): ! attrs[name.lower()] = value ! for att in ('class',): # append to node attribute if node.has_key(att): ! if attrs.has_key(att): ! attrs[att] = node[att] + ' ' + attrs[att] ! for att in ('id',): # node attribute overrides ! if node.has_key(att): ! attrs[att] = node[att] ! attlist = attrs.items() attlist.sort() ! return '<%s>%s' % (' '.join([tagname.upper()] ! + ['%s="%s"' % (name.upper(), ! self.encode(value)) ! for name, value in attlist]), suffix) *************** *** 204,211 **** def visit_docinfo(self, node): # @@@ as a table? ! pass def depart_docinfo(self, node): ! pass def visit_doctest_block(self, node): --- 212,219 ---- def visit_docinfo(self, node): # @@@ as a table? ! self.body.append(self.starttag(node, 'DIV', CLASS='docinfo')) def depart_docinfo(self, node): ! self.body.append('</DIV>\n') def visit_doctest_block(self, node): *************** *** 475,482 **** def visit_system_message(self, node): ! pass def depart_system_message(self, node): ! pass def visit_table(self, node): --- 483,491 ---- def visit_system_message(self, node): ! self.body.append(self.starttag(node, 'DIV', CLASS='system_message')) ! self.body.append('<H3>%s (%s)</H3>\n' % (node['type'], node['level'])) def depart_system_message(self, node): ! self.body.append('</DIV>\n') def visit_table(self, node): |
From: David G. <go...@us...> - 2002-02-22 01:58:06
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv26339/dps/test/test_transforms Added Files: test_messages.py Log Message: Tests for dps.transforms.universal.Messages. --- NEW FILE: test_messages.py --- #! /usr/bin/env python """ :Author: David Goodger :Contact: go...@us... :Revision: $Revision: 1.1 $ :Date: $Date: 2002/02/22 01:58:02 $ :Copyright: This module has been placed in the public domain. Tests for dps.transforms.universal.Messages. """ import DPSTestSupport from dps.transforms.universal import Messages from dps.transforms.references import Substitutions import UnitTestFolder try: from restructuredtext import Parser except ImportError: from dps.parsers.restructuredtext import Parser def suite(): parser = Parser() s = DPSTestSupport.TransformTestSuite(parser) s.generateTests(totest) return s totest = {} totest['system_message_sections'] = ((Substitutions, Messages,), [ ["""\ This |unknown substitution| will generate a system message, thanks to the ``Substitutions`` transform. The ``Messages`` transform will generate a "System Messages" section. (A second copy of the system message is tacked on to the end of the doctree by the test framework.) """, """\ <document> <paragraph> This \n\ <problematic> unknown substitution will generate a system message, thanks to the \n\ <literal> Substitutions transform. The \n\ <literal> Messages transform will generate a "System Messages" section. <paragraph> (A second copy of the system message is tacked on to the end of the doctree by the test framework.) <section class="system_messages"> <title> Docutils System Messages <system_message level="3" type="ERROR"> <paragraph> Undefined substitution referenced: "unknown substitution". <system_message level="3" type="ERROR"> <paragraph> Undefined substitution referenced: "unknown substitution". """], ]) if __name__ == '__main__': import unittest unittest.main(defaultTest='suite') |
From: David G. <go...@us...> - 2002-02-22 01:57:25
|
Update of /cvsroot/docstring/dps/test/test_transforms In directory usw-pr-cvs1:/tmp/cvs-serv26058/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.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_docinfo.py 20 Feb 2002 04:45:57 -0000 1.6 --- test_docinfo.py 22 Feb 2002 01:57:22 -0000 1.7 *************** *** 51,59 **** <date> 2001-08-11 ! <abstract> ! <paragraph> ! There can only be one abstract. ! <paragraph> ! It is automatically moved to the end of the other bibliographic elements. <comment> Bibliographic element extraction. --- 51,59 ---- <date> 2001-08-11 ! <abstract> ! <paragraph> ! There can only be one abstract. ! <paragraph> ! It is automatically moved to the end of the other bibliographic elements. <comment> Bibliographic element extraction. *************** *** 91,97 **** <date> 2001-08-11 ! <abstract> ! <paragraph> ! Abstract 1. <comment> Bibliographic element extraction. --- 91,97 ---- <date> 2001-08-11 ! <abstract> ! <paragraph> ! Abstract 1. <comment> Bibliographic element extraction. |
From: David G. <go...@us...> - 2002-02-22 01:57:03
|
Update of /cvsroot/docstring/dps/test In directory usw-pr-cvs1:/tmp/cvs-serv25818/dps/test Modified Files: DPSTestSupport.py Log Message: Added support for dps.transforms.universal.test_transforms. Index: DPSTestSupport.py =================================================================== RCS file: /cvsroot/docstring/dps/test/DPSTestSupport.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DPSTestSupport.py 6 Feb 2002 03:10:12 -0000 1.5 --- DPSTestSupport.py 22 Feb 2002 01:57:00 -0000 1.6 *************** *** 32,35 **** --- 32,36 ---- from dps import statemachine, nodes, urischemes, utils, transforms + from dps.transforms import universal import unittest, difflib, inspect, os, sys *************** *** 226,230 **** debug=UnitTestFolder.debug) self.parser.parse(self.input, doctree) ! for transformClass in self.transforms: transformClass().transform(doctree) output = doctree.pformat() --- 227,231 ---- debug=UnitTestFolder.debug) self.parser.parse(self.input, doctree) ! for transformClass in (self.transforms + universal.test_transforms): transformClass().transform(doctree) output = doctree.pformat() |
From: David G. <go...@us...> - 2002-02-22 01:53:59
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv24328/dps/spec Modified Files: gpdi.dtd Log Message: - Made ``abstract`` a structural element, after ``docinfo``. Index: gpdi.dtd =================================================================== RCS file: /cvsroot/docstring/dps/spec/gpdi.dtd,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** gpdi.dtd 20 Feb 2002 04:10:29 -0000 1.32 --- gpdi.dtd 22 Feb 2002 01:53:48 -0000 1.33 *************** *** 168,172 **** <!-- Optional elements may be generated by internal processing. --> ! <!ELEMENT document ((title, subtitle?)?, docinfo?, %structure.model;)> <!ATTLIST document %basic.atts;> --- 168,173 ---- <!-- Optional elements may be generated by internal processing. --> ! <!ELEMENT document ! ((title, subtitle?)?, docinfo?, abstract?, %structure.model;)> <!ATTLIST document %basic.atts;> *************** *** 192,197 **** <!-- Container for bibliographic elements. May not be empty. --> ! <!ELEMENT docinfo ! (((%bibliographic.elements;)+, abstract?) | abstract)> <!ATTLIST docinfo %basic.atts;> --- 193,197 ---- <!-- Container for bibliographic elements. May not be empty. --> ! <!ELEMENT docinfo (%bibliographic.elements;)+> <!ATTLIST docinfo %basic.atts;> *************** *** 223,229 **** <!ATTLIST copyright %basic.atts;> - <!ELEMENT abstract (%body.elements;)+> - <!ATTLIST abstract %basic.atts;> - <!-- --- 223,226 ---- *************** *** 232,235 **** --- 229,235 ---- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> + + <!ELEMENT abstract (%body.elements;)+> + <!ATTLIST abstract %basic.atts;> <!ELEMENT section (title, %structure.model;)> |