diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-05-31 14:13:04 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-05-31 14:13:04 (GMT) |
commit | 7ce734cd72bc32b5062f90f37fbe0cbc3c0e104e (patch) | |
tree | 567723f528cd14f51e7744b981935bbda03fe024 /Lib/markupbase.py | |
parent | 05ab2e693cf5bed23e14058cf9eb458441769122 (diff) | |
download | cpython-7ce734cd72bc32b5062f90f37fbe0cbc3c0e104e.zip cpython-7ce734cd72bc32b5062f90f37fbe0cbc3c0e104e.tar.gz cpython-7ce734cd72bc32b5062f90f37fbe0cbc3c0e104e.tar.bz2 |
Use string methods where possible, and remove import string
Diffstat (limited to 'Lib/markupbase.py')
-rw-r--r-- | Lib/markupbase.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/markupbase.py b/Lib/markupbase.py index 57d3ae4..ae19869 100644 --- a/Lib/markupbase.py +++ b/Lib/markupbase.py @@ -38,10 +38,10 @@ class ParserBase: if i >= j: return j rawdata = self.rawdata - nlines = string.count(rawdata, "\n", i, j) + nlines = rawdata.count("\n", i, j) if nlines: self.lineno = self.lineno + nlines - pos = string.rindex(rawdata, "\n", i, j) # Should not fail + pos = rawdata.rindex("\n", i, j) # Should not fail self.offset = j-(pos+1) else: self.offset = self.offset + j-i @@ -176,7 +176,7 @@ class ParserBase: # style content model; just skip until '>' rawdata = self.rawdata if '>' in rawdata[j:]: - return string.find(rawdata, ">", j) + 1 + return rawdata.find(">", j) + 1 return -1 # Internal -- scan past <!ATTLIST declarations @@ -200,7 +200,7 @@ class ParserBase: if c == "(": # an enumerated type; look for ')' if ")" in rawdata[j:]: - j = string.find(rawdata, ")", j) + 1 + j = rawdata.find(")", j) + 1 else: return -1 while rawdata[j:j+1] in string.whitespace: @@ -307,7 +307,7 @@ class ParserBase: name = s.strip() if (i + len(s)) == n: return None, -1 # end of buffer - return string.lower(name), m.end() + return name.lower(), m.end() else: self.updatepos(declstartpos, i) self.error("expected name token") |