[Python-checkins] CVS: python/dist/src/Tools/idle FileList.py,1.8,1.9

Guido van Rossum gvanrossum@users.sourceforge.net
2001年5月12日 05:11:38 -0700


Update of /cvsroot/python/python/dist/src/Tools/idle
In directory usw-pr-cvs1:/tmp/cvs-serv12447
Modified Files:
	FileList.py 
Log Message:
Delete goodname() method, which is unused.
Add gotofileline(), a convenience method which I intend to use in a
variant.
Rename test() to _test().
Index: FileList.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/idle/FileList.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** FileList.py	2001年01月17日 08:48:39	1.8
--- FileList.py	2001年05月12日 12:11:36	1.9
***************
*** 25,37 ****
 self.vars = {} # For EditorWindow.getrawvar (shared Tcl variables)
 
- 
- def goodname(self, filename):
- filename = self.canonize(filename)
- key = os.path.normcase(filename)
- if self.dict.has_key(key):
- edit = self.dict[key]
- filename = edit.io.filename or filename
- return filename
- 
 def open(self, filename):
 assert filename
--- 25,28 ----
***************
*** 55,58 ****
--- 46,54 ----
 return self.EditorWindow(self, filename, key)
 
+ def gotofileline(self, filename, lineno=None):
+ edit = self.open(filename)
+ if edit is not None and lineno is not None:
+ edit.gotoline(lineno)
+ 
 def new(self):
 return self.EditorWindow(self)
***************
*** 124,128 ****
 
 
! def test():
 from EditorWindow import fixwordbreaks
 import sys
--- 120,124 ----
 
 
! def _test():
 from EditorWindow import fixwordbreaks
 import sys
***************
*** 140,142 ****
 
 if __name__ == '__main__':
! test()
--- 136,138 ----
 
 if __name__ == '__main__':
! _test()

AltStyle によって変換されたページ (->オリジナル) /