diff options
author | Walter Dörwald <walter@livinglogic.de> | 2002-09-11 20:36:02 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2002-09-11 20:36:02 (GMT) |
commit | aaab30e00cc3e8d90c71b8657c284feeb4ac1413 (patch) | |
tree | d055e0bd374770014d9afdff1b961418b1828584 /Tools/scripts/pindent.py | |
parent | 6a0477b099560a452e37fe77c3850bf232487c16 (diff) | |
download | cpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.zip cpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.tar.gz cpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.tar.bz2 |
Apply diff2.txt from SF patch http://www.python.org/sf/572113
(with one small bugfix in bgen/bgen/scantools.py)
This replaces string module functions with string methods
for the stuff in the Tools directory. Several uses of
string.letters etc. are still remaining.
Diffstat (limited to 'Tools/scripts/pindent.py')
-rwxr-xr-x | Tools/scripts/pindent.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Tools/scripts/pindent.py b/Tools/scripts/pindent.py index 318c20e..75175dc 100755 --- a/Tools/scripts/pindent.py +++ b/Tools/scripts/pindent.py @@ -83,7 +83,6 @@ EXPANDTABS = 0 import os import re -import string import sys next = {} @@ -119,7 +118,7 @@ class PythonIndenter: def write(self, line): if self.expandtabs: - self._write(string.expandtabs(line, self.tabsize)) + self._write(line.expandtabs(self.tabsize)) else: self._write(line) # end if @@ -270,7 +269,7 @@ class PythonIndenter: thiskw = '' # end if # end if - indent = len(string.expandtabs(line[:i], self.tabsize)) + indent = len(line[:i].expandtabs(self.tabsize)) while indent < current: if firstkw: if topid: @@ -370,7 +369,7 @@ class StringReader: return r # end def read def readline(self): - i = string.find(self.buf, '\n', self.pos) + i = self.buf.find('\n', self.pos) return self.read(i + 1 - self.pos) # end def readline def readlines(self): @@ -514,9 +513,9 @@ def test(): # end if action = 'reformat' elif o == '-s': - stepsize = string.atoi(a) + stepsize = int(a) elif o == '-t': - tabsize = string.atoi(a) + tabsize = int(a) elif o == '-e': expandtabs = 1 # end if |