[Zope-Checkins] CVS: Zope/lib/python/StructuredText - ClassicDocumentClass.py:1.21 ClassicStructuredText.py:1.4 DocBookClass.py:1.5 DocumentClass.py:1.43 HTMLClass.py:1.18 HTMLWithImages.py:1.5
Andreas Jung
andreas@zope.com
Fri, 21 Dec 2001 11:00:17 -0500
Update of /cvs-repository/Zope/lib/python/StructuredText
In directory cvs.zope.org:/tmp/cvs-serv24975
Modified Files:
ClassicDocumentClass.py ClassicStructuredText.py
DocBookClass.py DocumentClass.py HTMLClass.py
HTMLWithImages.py
Log Message:
minor codecleanup (unused vars found by pychecker)
=== Zope/lib/python/StructuredText/ClassicDocumentClass.py 1.20 => 1.21 ===
subs = paragraph.getSubparagraphs()
- indent=paragraph.indent
+# indent=paragraph.indent
return StructuredTextTable(result,text,subs,indent=paragraph.indent)
def doc_bullet(self, paragraph, expr = re.compile('\s*[-*o]\s+').match):
=== Zope/lib/python/StructuredText/ClassicStructuredText.py 1.3 => 1.4 ===
if not r: return ''
if not r[-1]: del r[-1]
- tab=' '*level
+ tab=' '*indent
return "%s%s\n" % (tab,join(r,'\n'+tab))
def reindent(aString, indent=2, already_untabified=0):
=== Zope/lib/python/StructuredText/DocBookClass.py 1.4 => 1.5 ===
##############################################################################
-import string
-from string import join, split, find, lstrip
class DocBookClass:
@@ -42,13 +40,13 @@
def __call__(self, doc, level=1):
r=[]
self.dispatch(doc, level-1, r.append)
- return join(r,'')
+ return ''.join(r)
def _text(self, doc, level, output):
if doc.getNodeName() == 'StructuredTextLiteral':
output(doc.getNodeValue())
else:
- output(lstrip(doc.getNodeValue()))
+ output(doc.getNodeValue().lstrip())
def document(self, doc, level, output):
output('<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN">\n')
@@ -178,20 +176,20 @@
def prestrip(v):
- v=string.replace(v, '\r\n', '\n')
- v=string.replace(v, '\r', '\n')
- v=string.replace(v, '\t', ' ')
- lines=string.split(v, '\n')
+ v=v.replace( '\r\n', '\n')
+ v=v.replace( '\r', '\n')
+ v=v.replace( '\t', ' ')
+ lines=v.split('\n')
indent=len(lines[0])
for line in lines:
if not len(line): continue
- i=len(line)-len(string.lstrip(line))
+ i=len(line)-len(line.lstrip())
if i < indent:
indent=i
nlines=[]
for line in lines:
nlines.append(line[indent:])
- return string.join(nlines, '\n')
+ return '\n'.join(nlines, '\n')
class DocBookChapter(DocBookClass):
=== Zope/lib/python/StructuredText/DocumentClass.py 1.42 => 1.43 ===
if paragraph.getNodeName() is "StructuredTextTable":
- cells = paragraph.getColumns()
+# cells = paragraph.getColumns()
text = paragraph.getColorizableTexts()
text = map(ST.StructuredText,text)
text = map(self.__call__,text)
=== Zope/lib/python/StructuredText/HTMLClass.py 1.17 => 1.18 ===
def paragraph(self, doc, level, output):
- i=0
+
output('<p>')
for c in doc.getChildNodes():
if c.getNodeName() in ['StructuredTextParagraph']:
=== Zope/lib/python/StructuredText/HTMLWithImages.py 1.4 => 1.5 ===
from string import join, split, find
import re, sys, ST
-import time
from HTMLClass import HTMLClass