Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9229
Modified Files:
document.py editor.py template.py vss.py
Log Message:
Replace use of string module with string methods
Index: vss.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/vss.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** vss.py 4 Jun 2000 06:19:33 -0000 1.3
--- vss.py 9 Aug 2008 16:47:20 -0000 1.4
***************
*** 51,55 ****
win32ui.MessageBox("%s\r\n\r\nThis directory is not configured for Python/VSS" % origPath)
return
! return project, string.join(retPaths, "/"), database
--- 51,55 ----
win32ui.MessageBox("%s\r\n\r\nThis directory is not configured for Python/VSS" % origPath)
return
! return project, "/".join(retPaths), database
Index: document.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/document.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** document.py 5 Jan 2007 20:44:33 -0000 1.10
--- document.py 9 Aug 2008 16:47:20 -0000 1.11
***************
*** 228,232 ****
try:
self.scModule = __import__(self.scModuleName)
! for part in string.split(self.scModuleName,'.')[1:]:
self.scModule = getattr(self.scModule, part)
except:
--- 228,232 ----
try:
self.scModule = __import__(self.scModuleName)
! for part in self.scModuleName.split('.')[1:]:
self.scModule = getattr(self.scModule, part)
except:
Index: template.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/template.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** template.py 11 Mar 2000 00:52:46 -0000 1.3
--- template.py 9 Aug 2008 16:47:20 -0000 1.4
***************
*** 22,26 ****
doc = self.FindOpenDocument(fileName)
if doc: return doc
! ext = string.lower(os.path.splitext(fileName)[1])
if ext in self.GetFileExtensions():
return win32ui.CDocTemplate_Confidence_yesAttemptNative
--- 22,26 ----
doc = self.FindOpenDocument(fileName)
if doc: return doc
! ext = os.path.splitext(fileName)[1].lower()
if ext in self.GetFileExtensions():
return win32ui.CDocTemplate_Confidence_yesAttemptNative
Index: editor.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/editor.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** editor.py 7 Feb 2004 02:06:57 -0000 1.3
--- editor.py 9 Aug 2008 16:47:20 -0000 1.4
***************
*** 104,108 ****
"""Given raw data read from a file, massage it suitable for the edit window"""
# if a CR in the first 250 chars, then perform the expensive translate
! if string.find(data[:250],'\r')==-1:
win32ui.SetStatusText("Translating from Unix file format - please wait...",1)
return re.sub('\r*\n','\r\n',data)
--- 104,108 ----
"""Given raw data read from a file, massage it suitable for the edit window"""
# if a CR in the first 250 chars, then perform the expensive translate
! if data[:250].find('\r')==-1:
win32ui.SetStatusText("Translating from Unix file format - please wait...",1)
return re.sub('\r*\n','\r\n',data)
***************
*** 304,308 ****
try:
if lineNo is None:
! lineNo = string.atoi(raw_input("Enter Line Number"))
except (ValueError, KeyboardInterrupt):
return 0
--- 304,308 ----
try:
if lineNo is None:
! lineNo = int(raw_input("Enter Line Number"))
except (ValueError, KeyboardInterrupt):
return 0
***************
*** 335,339 ****
# look for a module name
! line=string.strip(self._obj_.GetLine())
flags=win32con.MF_STRING|win32con.MF_ENABLED
if patImport.match(line)==len(line):
--- 335,339 ----
# look for a module name
! line=self._obj_.GetLine().strip()
flags=win32con.MF_STRING|win32con.MF_ENABLED
if patImport.match(line)==len(line):
***************
*** 376,380 ****
# then copy the current indentation to this line.
res = patIndent.match(curLine,0)
! if res>0 and string.strip(curLine):
curIndent = patIndent.group(1)
self._obj_.ReplaceSel(curIndent)
--- 376,380 ----
# then copy the current indentation to this line.
res = patIndent.match(curLine,0)
! if res>0 and curLine.strip():
curIndent = patIndent.group(1)
self._obj_.ReplaceSel(curIndent)
|