docstring-checkins Mailing List for Docstring Processing System (Page 15)
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...> - 2001-09-17 03:58:59
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv12059/dps/dps Removed Files: test_statemachine.py Log Message: Moved out of DPS package into test directory. --- test_statemachine.py DELETED --- |
From: David G. <go...@us...> - 2001-09-17 03:58:42
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv12025/dps/dps Removed Files: test_nodes.py Log Message: Moved out of DPS package into test directory. --- test_nodes.py DELETED --- |
From: David G. <go...@us...> - 2001-09-17 03:56:28
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv11631/dps/dps Modified Files: statemachine.py Log Message: - Added 'uptoblank' optional argument to 'getindented', 'getknownindented', and 'getfirstknownindented' methods of StateWS, and to 'extractindented' function. Index: statemachine.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/statemachine.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** statemachine.py 2001/09/13 02:15:35 1.9 --- statemachine.py 2001/09/17 03:56:25 1.10 *************** *** 722,733 **** return context, '', [] # neither blank line nor indented ! def getindented(self): """ ! Return an indented block and info. Extract an indented block where the indent is unknown for all lines. ! Return: ! - the indented block, - its indent, - its first line offset from BOF, and --- 722,734 ---- return context, '', [] # neither blank line nor indented ! def getindented(self, uptoblank=0): """ ! Return a indented lines of text and info. Extract an indented block where the indent is unknown for all lines. ! Stop extracting at the first blank line If `uptoblank` is set to ! true (1). Return: ! - the indented block (a list of lines of text), - its indent, - its first line offset from BOF, and *************** *** 736,740 **** offset = self.abslineoffset() indented, indent, blankfinish = extractindented( ! self.inputlines[self.lineoffset:]) if indented: self.nextline(len(indented) - 1) # advance to last indented line --- 737,741 ---- offset = self.abslineoffset() indented, indent, blankfinish = extractindented( ! self.inputlines[self.lineoffset:], uptoblank) if indented: self.nextline(len(indented) - 1) # advance to last indented line *************** *** 746,755 **** return indented, indent, offset, blankfinish ! def getknownindented(self, indent): """ Return an indented block and info. Extract an indented block where the indent is known for all lines. ! Return: - the indented block, --- 747,757 ---- return indented, indent, offset, blankfinish ! def getknownindented(self, indent, uptoblank=0): """ Return an indented block and info. Extract an indented block where the indent is known for all lines. ! Stop extracting at the first blank line If `uptoblank` is set to ! true (1). Return: - the indented block, *************** *** 769,772 **** --- 771,777 ---- blankfinish = not indented[-1].strip() and len(indented) > 1 break + if uptoblank and line.strip(): + blankfinish = 1 + break indented.append(line[indent:]) else: *************** *** 781,790 **** return indented, offset, blankfinish ! def getfirstknownindented(self, indent): """ Return an indented block and info. Extract an indented block where the indent is known for the first line ! and unknown for all other lines. Return: - the indented block, --- 786,796 ---- return indented, offset, blankfinish ! def getfirstknownindented(self, indent, uptoblank=0): """ Return an indented block and info. Extract an indented block where the indent is known for the first line ! and unknown for all other lines. Stop extracting at the first blank ! line If `uptoblank` is set to true (1). Return: - the indented block, *************** *** 798,802 **** indented = [self.line[indent:]] indented[1:], indent, blankfinish = extractindented( ! self.inputlines[self.lineoffset + 1:]) self.nextline(len(indented) - 1) # advance to last indented line while indented and not indented[-1].strip(): --- 804,808 ---- indented = [self.line[indent:]] indented[1:], indent, blankfinish = extractindented( ! self.inputlines[self.lineoffset + 1:], uptoblank) self.nextline(len(indented) - 1) # advance to last indented line while indented and not indented[-1].strip(): *************** *** 984,1000 **** return [s.expandtabs(tabwidth) for s in astring.splitlines()] ! def extractindented(lines): """ ! Extract and return a continuous indented block. ! Collect all lines with indentation, determine the minimum indentation, ! remove the minimum indentation from all indented lines, and return them. ! All lines up to but not including the first unindented line will be ! returned. ! ! Parameter `lines`: a list of one-line strings without newlines. ! Return: - a list of indented lines with mininum indent removed; - the amount of the indent; --- 990,1009 ---- return [s.expandtabs(tabwidth) for s in astring.splitlines()] ! def extractindented(lines, uptoblank=0): """ ! Extract and return a list of indented lines of text. ! Given a list of one-line strings without newlines (`lines`), collect all ! lines with indentation, determine the minimum indentation, remove the ! minimum indentation from all indented lines, and return them. All lines up ! to but not including the first unindented line will be returned. Stop ! collecting at the first blank line If `uptoblank` is set to true (1) ! :Parameters: + - `lines`: . + + :Return: + - a list of indented lines with mininum indent removed; - the amount of the indent; *************** *** 1009,1014 **** blankfinish = len(source) and not source[-1].strip() break - source.append(line) stripped = line.lstrip() if not stripped: # blank line continue --- 1018,1026 ---- blankfinish = len(source) and not source[-1].strip() break stripped = line.lstrip() + if uptoblank and not stripped: # blank line + blankfinish = 1 + break + source.append(line) if not stripped: # blank line continue |
From: David G. <go...@us...> - 2001-09-17 03:54:33
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv11404/dps/dps Modified Files: utils.py Log Message: - Renamed error reporter class to 'Reporter' from 'Errorist'. Seemed clever at the time; seems less so now. - Added docstrings. Index: utils.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/utils.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** utils.py 2001/09/10 04:07:11 1.5 --- utils.py 2001/09/17 03:54:29 1.6 *************** *** 20,29 **** ! class Errorist: def __init__(self, warninglevel, errorlevel, warningstream=sys.stderr): self.warninglevel = warninglevel self.errorlevel = errorlevel self.stream = warningstream def system_warning(self, level, comment=None, children=[]): --- 20,36 ---- ! class Reporter: def __init__(self, warninglevel, errorlevel, warningstream=sys.stderr): self.warninglevel = warninglevel + """The level at or above which warning output will be sent to + `self.stream`.""" + self.errorlevel = errorlevel + """The level at or above which `SystemWarning` exceptions will be + raised.""" + self.stream = warningstream + """Where warning output is sent.""" def system_warning(self, level, comment=None, children=[]): |
From: David G. <go...@us...> - 2001-09-13 02:16:40
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv4963/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.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** dps-notes.txt 2001/09/12 03:49:00 1.11 --- dps-notes.txt 2001/09/13 02:16:38 1.12 *************** *** 33,39 **** - DTD element semantics. - - statemachine.py: Add nestedSM, nestedSMkwargs to State? StateWS - instances can default to these. - - Get cracking on the DPS itself! --- 33,36 ---- |
From: David G. <go...@us...> - 2001-09-13 02:16:27
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv4892/dps Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** HISTORY.txt 2001/09/12 03:48:44 1.14 --- HISTORY.txt 2001/09/13 02:16:24 1.15 *************** *** 44,48 **** - Added 'vms_option'. - Added 'classifier'. ! - Added 'error'. - Fixed link bookkeeping. - Added docstrings to _Element. --- 44,48 ---- - Added 'vms_option'. - Added 'classifier'. ! - Added 'error', 'attention'. - Fixed link bookkeeping. - Added docstrings to _Element. *************** *** 51,55 **** - Allow any DOM implementation from ``asdom()`` method. (I think.) - _Node's always true. ! - Changed .pprint() to .pformat(). - Added slice support to elements. - Added .findclass() & .findnonclass() methods. --- 51,55 ---- - Allow any DOM implementation from ``asdom()`` method. (I think.) - _Node's always true. ! - Changed .pprint() to .pformat(); removed endtags from output. - Added slice support to elements. - Added .findclass() & .findnonclass() methods. *************** *** 74,77 **** --- 74,78 ---- - Added form feed & vertical tab conversion to string2lines. - Added StateMachine.nextlineblank(). + - Added 'nestedSM' and 'nestedSMkwargs' to State. * dps/utils.py: |
From: David G. <go...@us...> - 2001-09-13 02:16:01
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv4701/dps/dps Modified Files: test_nodes.py Log Message: updated Index: test_nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/test_nodes.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_nodes.py 2001/09/07 02:05:22 1.3 --- test_nodes.py 2001/09/13 02:15:58 1.4 *************** *** 55,59 **** self.assertEquals(dom.toxml(), '<_Element attr="1"/>') dom.unlink() ! self.assertEquals(element.pformat(), '<_Element attr="1"/>\n') def test_withtext(self): --- 55,59 ---- self.assertEquals(dom.toxml(), '<_Element attr="1"/>') dom.unlink() ! self.assertEquals(element.pformat(), '<_Element attr="1">\n') def test_withtext(self): *************** *** 77,81 **** text more - </_Element> """) --- 77,80 ---- |
From: David G. <go...@us...> - 2001-09-13 02:15:37
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv4428/dps/dps Modified Files: statemachine.py Log Message: - Added 'nestedSM' and 'nestedSMkwargs' to State. Index: statemachine.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/statemachine.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** statemachine.py 2001/09/12 03:45:42 1.8 --- statemachine.py 2001/09/13 02:15:35 1.9 *************** *** 71,75 **** transition methods, which handle the beginning- and end-of-file. ! e) If you are using `StateWS` as a base class, in order to handle nested indented blocks, you may wish to: --- 71,78 ---- transition methods, which handle the beginning- and end-of-file. ! e) In order to handle nested processing, you may wish to override the ! attributes `State.nestedSM` and/or `State.nestedSMkwargs`. ! ! If you are using `StateWS` as a base class, in order to handle nested indented blocks, you may wish to: *************** *** 456,459 **** --- 459,484 ---- """ + nestedSM = None + """ + The `StateMachine` class for handling nested processing. + + If left as ``None``, `nestedSM` defaults to the class of the state's + controlling state machine. Override it in subclasses to avoid the default. + """ + + nestedSMkwargs = None + """ + Keyword arguments dictionary, passed to the `nestedSM` constructor. + + Two keys must have entries in the dictionary: + + - Key 'stateclasses' must be set to a list of `State` classes. + - Key 'initialstate' must be set to the name of the initial state class. + + If `nestedSMkwargs` is left as ``None``, 'stateclasses' defaults to the + class of the current state, and 'initialstate' defaults to the name of the + class of the current state. Override in subclasses to avoid the defaults. + """ + def __init__(self, statemachine, debug=0): """ *************** *** 488,491 **** --- 513,522 ---- """Debugging mode on/off.""" + if self.nestedSM is None: + self.nestedSM = self.statemachine.__class__ + if self.nestedSMkwargs is None: + self.nestedSMkwargs = {'stateclasses': [self.__class__], + 'initialstate': self.__class__.__name__} + def unlink(self): """Remove circular references to objects no longer required.""" *************** *** 800,805 **** The `StateMachine` class handling indented text blocks. ! If left as ``None``, `indentSM` defaults to the class of the state's ! controlling state machine. Override it in subclasses to avoid the default. """ --- 831,836 ---- The `StateMachine` class handling indented text blocks. ! If left as ``None``, `indentSM` defaults to the value of `State.nestedSM`. ! Override it in subclasses to avoid the default. """ *************** *** 808,819 **** Keyword arguments dictionary, passed to the `indentSM` constructor. ! Two keys must have entries in the dictionary: ! ! - Key 'stateclasses' must be set to a list of `State` classes. ! - Key 'initialstate' must be set to the name of the initial state class. ! ! If `indentSMkwargs` is left as ``None``, 'stateclasses' defaults to the ! class of the current state, and 'initialstate' defaults to the name of the ! class of the current state. Override in subclasses to avoid the defaults. """ --- 839,844 ---- Keyword arguments dictionary, passed to the `indentSM` constructor. ! If left as ``None``, `indentSMkwargs` defaults to the value of ! `State.nestedSMkwargs`. Override it in subclasses to avoid the default. """ *************** *** 828,832 **** knownindentSMkwargs = None """ ! Keyword arguments dictionary, passed to the `indentSM` constructor. If left as ``None``, `knownindentSMkwargs` defaults to the value of --- 853,857 ---- knownindentSMkwargs = None """ ! Keyword arguments dictionary, passed to the `knownindentSM` constructor. If left as ``None``, `knownindentSMkwargs` defaults to the value of *************** *** 842,849 **** State.__init__(self, statemachine, debug) if self.indentSM is None: ! self.indentSM = self.statemachine.__class__ if self.indentSMkwargs is None: ! self.indentSMkwargs = {'stateclasses': [self.__class__], ! 'initialstate': self.__class__.__name__} if self.knownindentSM is None: self.knownindentSM = self.indentSM --- 867,873 ---- State.__init__(self, statemachine, debug) if self.indentSM is None: ! self.indentSM = self.nestedSM if self.indentSMkwargs is None: ! self.indentSMkwargs = self.nestedSMkwargs if self.knownindentSM is None: self.knownindentSM = self.indentSM |
From: David G. <go...@us...> - 2001-09-13 02:12:57
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv3448/dps/dps Modified Files: nodes.py Log Message: - Removed endtags from .pformat() output. - Reordered admonitions. - Added 'attention' admonition. Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** nodes.py 2001/09/12 03:47:12 1.9 --- nodes.py 2001/09/13 02:12:55 1.10 *************** *** 279,289 **** def pformat(self, indent=' ', level=0): ! if self.children: ! return ''.join(['%s%s\n' % (indent * level, self.starttag())] + [child.pformat(indent, level+1) ! for child in self.children] ! + ['%s%s\n' % (indent * level, self.endtag())]) ! else: ! return '%s%s\n' % (indent * level, self.emptytag()) --- 279,285 ---- def pformat(self, indent=' ', level=0): ! return ''.join(['%s%s\n' % (indent * level, self.starttag())] + [child.pformat(indent, level+1) ! for child in self.children]) *************** *** 471,481 **** class literal_block(_TextElement): pass class block_quote(_Element): pass ! class note(_Element): pass ! class tip(_Element): pass ! class warning(_Element): pass ! class error(_Element): pass class caution(_Element): pass class danger(_Element): pass class important(_Element): pass class comment(_TextElement): pass class directive(_Element): pass --- 467,478 ---- class literal_block(_TextElement): pass class block_quote(_Element): pass ! class attention(_Element): pass class caution(_Element): pass class danger(_Element): pass + class error(_Element): pass class important(_Element): pass + class note(_Element): pass + class tip(_Element): pass + class warning(_Element): pass class comment(_TextElement): pass class directive(_Element): pass |
From: David G. <go...@us...> - 2001-09-12 03:49:03
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv11823/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.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** dps-notes.txt 2001/09/05 02:38:55 1.10 --- dps-notes.txt 2001/09/12 03:49:00 1.11 *************** *** 33,36 **** --- 33,39 ---- - DTD element semantics. + - statemachine.py: Add nestedSM, nestedSMkwargs to State? StateWS + instances can default to these. + - Get cracking on the DPS itself! |
From: David G. <go...@us...> - 2001-09-12 03:48:47
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv11769/dps Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** HISTORY.txt 2001/09/10 04:22:57 1.13 --- HISTORY.txt 2001/09/12 03:48:44 1.14 *************** *** 19,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, Michel ! Pelletier, Sam Penrose, Tim Peters, Mark Pilgrim, Tavis Rudd, 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 --- 19,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, 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 *************** *** 42,47 **** * dps/nodes.py: ! - Added vms_option. ! - Added classifier. - Fixed link bookkeeping. - Added docstrings to _Element. --- 42,48 ---- * dps/nodes.py: ! - Added 'vms_option'. ! - Added 'classifier'. ! - Added 'error'. - Fixed link bookkeeping. - Added docstrings to _Element. *************** *** 72,75 **** --- 73,77 ---- - Fixed bug in StateMachine.getunindented(). - Added form feed & vertical tab conversion to string2lines. + - Added StateMachine.nextlineblank(). * dps/utils.py: *************** *** 122,125 **** --- 124,129 ---- - Moved 'abstract' into the bibliographic elements section. - Changed 'graphic' to 'image'. + - Moved 'caption' to after 'image' in 'figure'. + - Added 'error' admonishment element. * spec/pdpi.dtd: |
From: David G. <go...@us...> - 2001-09-12 03:47:15
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv11409/dps/dps Modified Files: nodes.py Log Message: - Added 'error' class. Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** nodes.py 2001/09/10 04:17:38 1.8 --- nodes.py 2001/09/12 03:47:12 1.9 *************** *** 474,477 **** --- 474,478 ---- class tip(_Element): pass class warning(_Element): pass + class error(_Element): pass class caution(_Element): pass class danger(_Element): pass |
From: David G. <go...@us...> - 2001-09-12 03:45:45
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv11161/dps/dps Modified Files: statemachine.py Log Message: - Added StateMachine.nextlineblank(). Index: statemachine.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/statemachine.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** statemachine.py 2001/08/25 03:55:14 1.7 --- statemachine.py 2001/09/12 03:45:42 1.8 *************** *** 252,255 **** --- 252,262 ---- return self.line + def nextlineblank(self): + """Return 1 if the next line is blank or non-existant.""" + try: + return not self.inputlines[self.lineoffset + 1].strip() + except IndexError: + return 1 + def previousline(self, n=1): """Load `self.line` with the `n`'th previous line and return it.""" |
From: David G. <go...@us...> - 2001-09-12 03:39:26
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv9846/dps/spec Modified Files: gpdi.dtd Log Message: - Moved 'caption' to after 'image' in 'figure'. - Added 'error' admonishment element. Index: gpdi.dtd =================================================================== RCS file: /cvsroot/docstring/dps/spec/gpdi.dtd,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** gpdi.dtd 2001/09/10 04:19:05 1.13 --- gpdi.dtd 2001/09/12 03:39:23 1.14 *************** *** 94,98 **** | option_list | literal_block | block_quote | doctest_block | table | figure ! | note | tip | warning | caution | danger | important | footnote | target | directive | comment | system_warning --- 94,98 ---- | option_list | literal_block | block_quote | doctest_block | table | figure ! | note | tip | warning | error | caution | danger | important | footnote | target | directive | comment | system_warning *************** *** 311,314 **** --- 311,317 ---- <!ATTLIST warning %basic.atts;> + <!ELEMENT error (%body.elements;)+> + <!ATTLIST error %basic.atts;> + <!ELEMENT caution (%body.elements;)+> <!ATTLIST caution %basic.atts;> *************** *** 342,346 **** %fixedspace.att;> ! <!ELEMENT figure (caption?, image, legend?)> <!ATTLIST figure %basic.atts;> --- 345,349 ---- %fixedspace.att;> ! <!ELEMENT figure (image, caption?, legend?)> <!ATTLIST figure %basic.atts;> |
From: David G. <go...@us...> - 2001-09-10 04:23:00
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv21068/dps Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** HISTORY.txt 2001/09/07 02:13:11 1.12 --- HISTORY.txt 2001/09/10 04:22:57 1.13 *************** *** 54,57 **** --- 54,63 ---- - Added .findclass() & .findnonclass() methods. - Added support for auto-numbered footnotes. + - Changed 'tagName' to 'tagname'. + - Improved auto-tagname generation. + - Added string-conversion to attribute values in DOM-conversion. + - Changed footnote/footnote_reference 'auto' attribute to integer. + - Moved 'abstract' into bibliographic elements section. + - Changed 'graphic' to 'image'. * dps/roman.py: Added to project. Written by and courtesy of Mark *************** *** 71,75 **** - Added named methods (aliases to numbered system_warning calls) to Errorist. - - Added language module support. * dps/parsers/model.py: --- 77,80 ---- *************** *** 77,86 **** - Added setup_parse() so unoverridden parse() could raise a NotImplementedError. - - Added language module support. ! * dps/languages/en.py: Now in use. - Fixed ``__all__``. - Changed node class names to node classes. * spec/pep-0256.txt: --- 82,95 ---- - Added setup_parse() so unoverridden parse() could raise a NotImplementedError. ! * dps/languages/__init__.py: ! ! - Added language module import function. + * dps/languages/en.py: + - Fixed ``__all__``. - Changed node class names to node classes. + - Removed parser-specific data. * spec/pep-0256.txt: *************** *** 112,115 **** --- 121,125 ---- - Made document subtitle dependent on the existence of a title. - Moved 'abstract' into the bibliographic elements section. + - Changed 'graphic' to 'image'. * spec/pdpi.dtd: |
From: David G. <go...@us...> - 2001-09-10 04:19:07
|
Update of /cvsroot/docstring/dps/spec In directory usw-pr-cvs1:/tmp/cvs-serv20129/dps/spec Modified Files: gpdi.dtd Log Message: - Changed 'graphic' to 'image'. Index: gpdi.dtd =================================================================== RCS file: /cvsroot/docstring/dps/spec/gpdi.dtd,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gpdi.dtd 2001/09/07 01:51:58 1.12 --- gpdi.dtd 2001/09/10 04:19:05 1.13 *************** *** 102,106 **** <!ENTITY % inline.elements " emphasis | strong | interpreted | literal ! | link | footnote_reference | graphic %additional.inline.elements; "> --- 102,106 ---- <!ENTITY % inline.elements " emphasis | strong | interpreted | literal ! | link | footnote_reference | image %additional.inline.elements; "> *************** *** 342,346 **** %fixedspace.att;> ! <!ELEMENT figure (caption?, graphic, legend?)> <!ATTLIST figure %basic.atts;> --- 342,346 ---- %fixedspace.att;> ! <!ELEMENT figure (caption?, image, legend?)> <!ATTLIST figure %basic.atts;> *************** *** 398,403 **** <!-- Also used in `figure`. --> ! <!ELEMENT graphic EMPTY> ! <!ATTLIST graphic %basic.atts; uri CDATA #REQUIRED --- 398,403 ---- <!-- Also used in `figure`. --> ! <!ELEMENT image EMPTY> ! <!ATTLIST image %basic.atts; uri CDATA #REQUIRED |
From: David G. <go...@us...> - 2001-09-10 04:17:40
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv19823/dps/dps Modified Files: nodes.py Log Message: - Changed 'tagName' to 'tagname'. - Improved auto-tagname generation. - Added string-conversion to attribute values in DOM-conversion. - Changed footnote/footnote_reference 'auto' attribute to integer. - Moved 'abstract' into bibliographic elements section. - Changed 'graphic' to 'image'. Index: nodes.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/nodes.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nodes.py 2001/09/07 02:08:41 1.7 --- nodes.py 2001/09/10 04:17:38 1.8 *************** *** 39,43 **** class Text(_Node, MutableString): ! tagName = '#text' def __repr__(self): --- 39,43 ---- class Text(_Node, MutableString): ! tagname = '#text' def __repr__(self): *************** *** 45,49 **** if len(data) > 70: data = repr(self.data[:64] + ' ...') ! return '<%s: %s>' % (self.tagName, data) def _dom_node(self, dom): --- 45,49 ---- if len(data) > 70: data = repr(self.data[:64] + ' ...') ! return '<%s: %s>' % (self.tagname, data) def _dom_node(self, dom): *************** *** 90,94 **** element += [node1, node2] """ ! childtextsep = '\n\n' """Separator for child nodes, used by `astext()` method.""" --- 90,98 ---- element += [node1, node2] """ ! ! tagname = None ! """The element generic identifier. If None, it is set as an instance ! attribute to the name of the class.""" ! childtextsep = '\n\n' """Separator for child nodes, used by `astext()` method.""" *************** *** 104,114 **** """Dictionary of attribute {name: value}.""" ! self.tagName = self.__class__.__name__ ! """The element generic identifier, usually the class name.""" def _dom_node(self, dom): ! element = dom.Element(self.tagName) for attribute, value in self.attributes.items(): ! element.setAttribute(attribute, value) for child in self.children: element.appendChild(child._dom_node(dom)) --- 108,118 ---- """Dictionary of attribute {name: value}.""" ! if self.tagname is None: ! self.tagname = self.__class__.__name__ def _dom_node(self, dom): ! element = dom.Element(self.tagname) for attribute, value in self.attributes.items(): ! element.setAttribute(attribute, str(value)) for child in self.children: element.appendChild(child._dom_node(dom)) *************** *** 116,122 **** def _rooted_dom_node(self, domroot): ! element = domroot.createElement(self.tagName) for attribute, value in self.attributes.items(): ! element.setAttribute(attribute, value) for child in self.children: element.appendChild(child._rooted_dom_node(domroot)) --- 120,126 ---- def _rooted_dom_node(self, domroot): ! element = domroot.createElement(self.tagname) for attribute, value in self.attributes.items(): ! element.setAttribute(attribute, str(value)) for child in self.children: element.appendChild(child._rooted_dom_node(domroot)) *************** *** 126,130 **** data = '' for c in self.children: ! data += '<%s...>' % c.tagName if len(data) > 60: data = data[:56] + ' ...' --- 130,134 ---- data = '' for c in self.children: ! data += '<%s...>' % c.tagname if len(data) > 60: data = data[:56] + ' ...' *************** *** 141,153 **** def starttag(self): ! return '<%s>' % ' '.join([self.tagName] + ['%s="%s"' % (n, v) for n, v in self.attlist()]) def endtag(self): ! return '</%s>' % self.tagName def emptytag(self): ! return '<%s/>' % ' '.join([self.tagName] + ['%s="%s"' % (n, v) for n, v in self.attlist()]) --- 145,157 ---- def starttag(self): ! return '<%s>' % ' '.join([self.tagname] + ['%s="%s"' % (n, v) for n, v in self.attlist()]) def endtag(self): ! return '</%s>' % self.tagname def emptytag(self): ! return '<%s/>' % ' '.join([self.tagname] + ['%s="%s"' % (n, v) for n, v in self.attlist()]) *************** *** 394,402 **** def addautofootnote(self, name, footnotenode): ! footnotenode['auto'] = '1' self.autofootnotes.append((name, footnotenode)) def addautofootnoteref(self, refname, refnode): ! refnode['auto'] = '1' self.autofootnoterefs.append((refname, refnode)) --- 398,406 ---- def addautofootnote(self, name, footnotenode): ! footnotenode['auto'] = 1 self.autofootnotes.append((name, footnotenode)) def addautofootnoteref(self, refname, refnode): ! refnode['auto'] = 1 self.autofootnoterefs.append((refname, refnode)) *************** *** 417,420 **** --- 421,425 ---- class date(_TextElement): pass class copyright(_TextElement): pass + class abstract(_Element): pass *************** *** 423,427 **** # ===================== - class abstract(_Element): pass class section(_Element): pass --- 428,431 ---- *************** *** 525,529 **** class link(_TextElement): pass class footnote_reference(_TextElement): pass ! class graphic(_TextElement): pass class package(_TextElement): pass --- 529,533 ---- class link(_TextElement): pass class footnote_reference(_TextElement): pass ! class image(_TextElement): pass class package(_TextElement): pass *************** *** 533,539 **** class inline_class(_TextElement): ! def __init__(self, *args, **kwargs): ! _TextElement.__init__(self, *args, **kwargs) ! self.tagName = 'class' --- 537,541 ---- class inline_class(_TextElement): ! tagname = 'class' |
From: David G. <go...@us...> - 2001-09-10 04:12:18
|
Update of /cvsroot/docstring/dps/dps/parsers In directory usw-pr-cvs1:/tmp/cvs-serv18753/dps/dps/parsers Modified Files: model.py Log Message: - Removed language module support. Index: model.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/parsers/model.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** model.py 2001/09/07 02:10:30 1.3 --- model.py 2001/09/10 04:12:15 1.4 *************** *** 15,19 **** self.errorlevel = errorlevel self.languagecode = languagecode - self.language = utils.language(languagecode) self.debug = debug --- 15,18 ---- |
From: David G. <go...@us...> - 2001-09-10 04:10:43
|
Update of /cvsroot/docstring/dps/dps/languages In directory usw-pr-cvs1:/tmp/cvs-serv18484/dps/dps/languages Modified Files: en.py Log Message: - Removed parser-specific data. Index: en.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/languages/en.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** en.py 2001/09/07 02:12:28 1.3 --- en.py 2001/09/10 04:10:40 1.4 *************** *** 1,88 **** #! /usr/bin/env python - # $Id$ - # by David Goodger (dgo...@bi...) - - """ - This module contains English-language mappings for language-dependent - features. - """ - - __all__ = ['parser', 'formatter'] - __docformat__ = 'reStructuredText' - - - from dps import nodes - - - class Stuff: - - """Stores a bunch of stuff for dotted-attribute access.""" - - def __init__(self, **keywordargs): - self.__dict__.update(keywordargs) - - parser = Stuff() """ ! Mappings for input parsers. Attributes: ! - bibliofields: Field name (lowcased) to node class name mapping for ! bibliographic elements. ! - authorseps: List of separator strings for 'Authors' fields, tried in order. ! - interpreted: Interpreted text role name to node class name mapping. ! - directives: Directive name to directive module name mapping. """ ! parser.bibliofields = {'title': nodes.title, ! 'subtitle': nodes.subtitle, ! 'author': nodes.author, ! 'authors': nodes.authors, ! 'organization': nodes.organization, ! 'contact': nodes.contact, ! 'version': nodes.version, ! 'revision': nodes.revision, ! 'status': nodes.status, ! 'date': nodes.date, ! 'copyright': nodes.copyright, ! 'abstract': nodes.abstract} ! parser.authorseps = [';', ','] - parser.interpreted = {'package': nodes.package, - 'module': nodes.module, - 'class': nodes.inline_class, - 'method': nodes.method, - 'function': nodes.function, - 'variable': nodes.variable, - 'parameter': nodes.parameter, - 'type': nodes.type, - 'class attribute': nodes.class_attribute, - 'classatt': nodes.class_attribute, - 'instance attribute': nodes.instance_attribute, - 'instanceatt': nodes.instance_attribute, - 'module attribute': nodes.module_attribute, - 'moduleatt': nodes.module_attribute, - 'exception class': nodes.exception_class, - 'exception': nodes.exception_class, - 'warning class': nodes.warning_class, - 'warning': nodes.warning_class,} ! parser.directives = {} - formatter = Stuff() - """ - Mappings for output formatters. Attributes: ! - bibliolabels: Bibliographic node class name to label text mapping. ! """ ! formatter.bibliolabels = {'title': 'Title', ! 'author': 'Author', ! 'authors': 'Authors', ! 'organization': 'Organization', ! 'contact': 'Contact', ! 'version': 'Version', ! 'revision': 'Revision', ! 'status': 'Status', ! 'date': 'Date', ! 'copyright': 'Copyright',} --- 1,54 ---- #! /usr/bin/env python """ ! :Author: David Goodger ! :Contact: go...@us... ! :Revision: $Revision$ ! :Date: $Date$ ! :Copyright: This module has been placed in the public domain. ! English-language mappings for language-dependent features of the Python ! Docstring Processing System. """ ! __docformat__ = 'reStructuredText' ! __all__ = ['interpreted', 'bibliographic_labels'] ! from dps import nodes ! interpreted = { ! 'package': nodes.package, ! 'module': nodes.module, ! 'class': nodes.inline_class, ! 'method': nodes.method, ! 'function': nodes.function, ! 'variable': nodes.variable, ! 'parameter': nodes.parameter, ! 'type': nodes.type, ! 'class attribute': nodes.class_attribute, ! 'classatt': nodes.class_attribute, ! 'instance attribute': nodes.instance_attribute, ! 'instanceatt': nodes.instance_attribute, ! 'module attribute': nodes.module_attribute, ! 'moduleatt': nodes.module_attribute, ! 'exception class': nodes.exception_class, ! 'exception': nodes.exception_class, ! 'warning class': nodes.warning_class, ! 'warning': nodes.warning_class,} ! """Mapping of interpreted text role name to nodes.py class.""" ! bibliographic_labels = { ! 'author': 'Author', ! 'authors': 'Authors', ! 'organization': 'Organization', ! 'contact': 'Contact', ! 'version': 'Version', ! 'revision': 'Revision', ! 'status': 'Status', ! 'date': 'Date', ! 'copyright': 'Copyright', ! 'abstract': 'Abstract'} ! """Mapping of bibliographic node class name to label text.""" |
From: David G. <go...@us...> - 2001-09-10 04:09:36
|
Update of /cvsroot/docstring/dps/dps/languages In directory usw-pr-cvs1:/tmp/cvs-serv18232/dps/dps/languages Modified Files: __init__.py Log Message: - Added language module import function. Index: __init__.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/languages/__init__.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** __init__.py 2001/07/22 22:35:40 1.1.1.1 --- __init__.py 2001/09/10 04:09:34 1.2 *************** *** 1,3 **** #! /usr/bin/env python ! # $Id$ ! # by David Goodger (dgo...@bi...) --- 1,28 ---- #! /usr/bin/env python ! ! """ ! :Author: David Goodger ! :Contact: go...@us... ! :Revision: $Revision$ ! :Date: $Date$ ! :Copyright: This module has been placed in the public domain. ! ! This package contains modules for language-dependent features of ! the Python Docstring Processing System. ! """ ! ! __docformat__ = 'reStructuredText' ! ! __all__ = ['language'] ! ! _languages = {} ! ! def language(languagecode): ! if _languages.has_key(languagecode): ! return _languages[languagecode] ! try: ! module = __import__(languagecode, globals(), locals()) ! except: ! raise ! _languages[languagecode] = module ! return module |
From: David G. <go...@us...> - 2001-09-10 04:07:14
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv17776/dps/dps Modified Files: utils.py Log Message: - Restored integer attribute 'level' on system_warning (fixed in XML conversion code). - Removed language support code; moved to dps/languages/__init__.py. Index: utils.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/utils.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** utils.py 2001/09/08 03:20:58 1.4 --- utils.py 2001/09/10 04:07:11 1.5 *************** *** 33,37 **** Raise an exception or generate a warning if appropriate. """ ! sw = nodes.system_warning(comment, level=str(level), *children) if level >= self.errorlevel: raise SystemWarning(sw) --- 33,37 ---- Raise an exception or generate a warning if appropriate. """ ! sw = nodes.system_warning(comment, level=level, *children) if level >= self.errorlevel: raise SystemWarning(sw) *************** *** 60,76 **** children.append(nodes.literal_block('', sourcetext)) return self.system_warning(3, children=children) - - - languages = {} - - def language(languagecode): - if languages.has_key(languagecode): - return languages[languagecode] - try: - module = getattr(__import__('dps.languages', globals(), locals(), - [languagecode]), - languagecode) - except: - raise - languages[languagecode] = module - return module --- 60,61 ---- |
From: David G. <go...@us...> - 2001-09-08 03:21:04
|
Update of /cvsroot/docstring/dps/dps In directory usw-pr-cvs1:/tmp/cvs-serv16379/dps/dps Modified Files: utils.py Log Message: - Fixed integer attribute bug on system_warning. Index: utils.py =================================================================== RCS file: /cvsroot/docstring/dps/dps/utils.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** utils.py 2001/09/07 02:03:14 1.3 --- utils.py 2001/09/08 03:20:58 1.4 *************** *** 33,37 **** Raise an exception or generate a warning if appropriate. """ ! sw = nodes.system_warning(comment, level=level, *children) if level >= self.errorlevel: raise SystemWarning(sw) --- 33,37 ---- Raise an exception or generate a warning if appropriate. """ ! sw = nodes.system_warning(comment, level=str(level), *children) if level >= self.errorlevel: raise SystemWarning(sw) |
From: David G. <go...@us...> - 2001-09-07 02:45:09
|
Update of /cvsroot/docstring/web In directory usw-pr-cvs1:/tmp/cvs-serv6557/web Modified Files: index.html.template Log Message: updated Index: index.html.template =================================================================== RCS file: /cvsroot/docstring/web/index.html.template,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index.html.template 2001/08/23 03:50:00 1.3 --- index.html.template 2001/09/07 02:45:07 1.4 *************** *** 109,112 **** --- 109,116 ---- </P></LI> + <LI><P><A HREF="spec/python-docstring-mode.txt"> + Python Docstring Mode</A> + </P></LI> + <LI><P><A HREF="spec/gpdi.dtd"> Generic Plaintext Document Interface DTD</A> *************** *** 196,202 **** <UL> ! <LI><P>Bug reports, patches, feature requests, mailing lists, news: <A ! HREF="http://sourceforge.net/projects/docstring/" >Python Docstring ! Processing System project page</A></P></LI> <LI><P><A --- 200,215 ---- <UL> ! <LI><P><A HREF="http://sourceforge.net/projects/docstring/" ! >Project Summary page</A>: <A ! HREF="http://sourceforge.net/tracker/?group_id=26626&atid=387775" ! >Bug reports</A>, <A ! HREF="http://sourceforge.net/tracker/?group_id=26626&atid=387777" ! >patches</A>, <A ! HREF="http://sourceforge.net/tracker/?group_id=26626&atid=387778" ! >feature requests</A>, <A ! HREF="http://sourceforge.net/mail/?group_id=26626" ! >mailing lists</A>, <A ! HREF="http://sourceforge.net/news/?group_id=26626" ! >news</A></P></LI> <LI><P><A |
From: David G. <go...@us...> - 2001-09-07 02:44:55
|
Update of /cvsroot/docstring/web In directory usw-pr-cvs1:/tmp/cvs-serv6528/web Modified Files: index.html Log Message: updated Index: index.html =================================================================== RCS file: /cvsroot/docstring/web/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index.html 2001/08/23 03:49:48 1.3 --- index.html 2001/09/07 02:44:53 1.4 *************** *** 11,15 **** ALT="Docstring Processing System" BORDER=0 ALIGN=bottom></A></P> ! <P><I>last updated: 2001-08-22</I></P> <P>The purpose of the Python Docstring Processing System project is to create --- 11,15 ---- ALT="Docstring Processing System" BORDER=0 ALIGN=bottom></A></P> ! <P><I>last updated: 2001-09-06</I></P> <P>The purpose of the Python Docstring Processing System project is to create *************** *** 108,111 **** --- 108,115 ---- </P></LI> + <LI><P><A HREF="spec/python-docstring-mode.txt"> + Python Docstring Mode</A> + </P></LI> + <LI><P><A HREF="spec/gpdi.dtd"> Generic Plaintext Document Interface DTD</A> *************** *** 195,201 **** <UL> ! <LI><P>Bug reports, patches, feature requests, mailing lists, news: <A ! HREF="http://sourceforge.net/projects/docstring/" >Python Docstring ! Processing System project page</A></P></LI> <LI><P><A --- 199,214 ---- <UL> ! <LI><P><A HREF="http://sourceforge.net/projects/docstring/" ! >Project Summary page</A>: <A ! HREF="http://sourceforge.net/tracker/?group_id=26626&atid=387775" ! >Bug reports</A>, <A ! HREF="http://sourceforge.net/tracker/?group_id=26626&atid=387777" ! >patches</A>, <A ! HREF="http://sourceforge.net/tracker/?group_id=26626&atid=387778" ! >feature requests</A>, <A ! HREF="http://sourceforge.net/mail/?group_id=26626" ! >mailing lists</A>, <A ! HREF="http://sourceforge.net/news/?group_id=26626" ! >news</A></P></LI> <LI><P><A |
From: David G. <go...@us...> - 2001-09-07 02:13:14
|
Update of /cvsroot/docstring/dps In directory usw-pr-cvs1:/tmp/cvs-serv811/dps Modified Files: HISTORY.txt Log Message: updated Index: HISTORY.txt =================================================================== RCS file: /cvsroot/docstring/dps/HISTORY.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** HISTORY.txt 2001/09/05 02:40:26 1.11 --- HISTORY.txt 2001/09/07 02:13:11 1.12 *************** *** 49,52 **** --- 49,57 ---- - Duplicate hyperlink names -> dupname attribute. - Allow any DOM implementation from ``asdom()`` method. (I think.) + - _Node's always true. + - Changed .pprint() to .pformat(). + - Added slice support to elements. + - Added .findclass() & .findnonclass() methods. + - Added support for auto-numbered footnotes. * dps/roman.py: Added to project. Written by and courtesy of Mark *************** *** 62,72 **** - Added form feed & vertical tab conversion to string2lines. * dps/parsers/model.py: - Added setup_parse() so unoverridden parse() could raise a NotImplementedError. ! * dps/languages/en.py: Fixed ``__all__``. * spec/pep-0256.txt: --- 67,87 ---- - Added form feed & vertical tab conversion to string2lines. + * dps/utils.py: + + - Added named methods (aliases to numbered system_warning calls) to + Errorist. + - Added language module support. + * dps/parsers/model.py: - Added setup_parse() so unoverridden parse() could raise a NotImplementedError. + - Added language module support. ! * dps/languages/en.py: Now in use. + - Fixed ``__all__``. + - Changed node class names to node classes. + * spec/pep-0256.txt: *************** *** 95,98 **** --- 110,115 ---- - Added 'morecols' attribute to table entries (<entry>), for simpler column span indication. + - Made document subtitle dependent on the existence of a title. + - Moved 'abstract' into the bibliographic elements section. * spec/pdpi.dtd: |