From: David G. <go...@us...> - 2002-10-25 07:44:37
|
Update of /cvsroot/docutils/docutils/docutils/transforms In directory usw-pr-cvs1:/tmp/cvs-serv15739/docutils/docutils/transforms Modified Files: peps.py Log Message: minor updates & fixes Index: peps.py =================================================================== RCS file: /cvsroot/docutils/docutils/docutils/transforms/peps.py,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- peps.py 24 Oct 2002 00:50:57 -0000 1.17 +++ peps.py 24 Oct 2002 23:29:59 -0000 1.18 @@ -160,18 +160,21 @@ i = len(doc) - 1 refsect = copyright = None while i >= 0 and isinstance(doc[i], nodes.section): - if 'references' in doc[i][0].astext().lower().split(): + title_words = doc[i][0].astext().lower().split() + if 'references' in title_words: refsect = doc[i] break - if 'copyright' in doc[i][0].astext().lower().split(): + elif 'copyright' in title_words: copyright = i i -= 1 if not refsect: refsect = nodes.section() refsect += nodes.title('', 'References') if copyright: + # Put the new "References" section before "Copyright": doc.insert(copyright, refsect) else: + # Put the new "References" section at end of doc: doc.append(refsect) pending = nodes.pending(references.TargetNotes) refsect.append(pending) |