Skip to content

Commit

Permalink
Replaced calls to functions from the string module in twisted.lore.
Browse files Browse the repository at this point in the history
Author: nueces
Reviewers: lvh
Fixes: twisted#4994

twisted.lore was previously using deprecated calls to functions in the string
module, which are deprecated in favor of str methods.



git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@31558 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
lvh committed Apr 6, 2011
1 parent c639285 commit c2393c8
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions twisted/lore/latex.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"""

from xml.dom import minidom as dom
import os.path, re, string
import os.path, re
from cStringIO import StringIO
import urlparse

@@ -207,7 +207,7 @@ def visitNodeHeader(self, node):
def visitNode_a_listing(self, node):
fileName = os.path.join(self.currDir, node.getAttribute('href'))
self.writer('\\begin{verbatim}\n')
lines = map(string.rstrip, open(fileName).readlines())
lines = map(str.rstrip, open(fileName).readlines())
skipLines = int(node.getAttribute('skipLines') or 0)
lines = lines[skipLines:]
self.writer(text.removeLeadingTrailingBlanks('\n'.join(lines)))
4 changes: 2 additions & 2 deletions twisted/lore/tree.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@


from itertools import count
import re, os, cStringIO, time, cgi, string, urlparse
import re, os, cStringIO, time, cgi, urlparse
from xml.dom import minidom as dom
from xml.sax.handler import ErrorHandler, feature_validation
from xml.dom.pulldom import SAX2DOM
@@ -199,7 +199,7 @@ def addPyListings(document, dir):
"py-listing"):
filename = node.getAttribute("href")
outfile = cStringIO.StringIO()
lines = map(string.rstrip, open(os.path.join(dir, filename)).readlines())
lines = map(str.rstrip, open(os.path.join(dir, filename)).readlines())

skip = node.getAttribute('skipLines') or 0
lines = lines[int(skip):]
Empty file added twisted/topfiles/4994.misc
Empty file.

0 comments on commit c2393c8

Please sign in to comment.