summaryrefslogtreecommitdiffstats
path: root/Tools/idle
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-05-12 12:11:36 (GMT)
committerGuido van Rossum <guido@python.org>2001-05-12 12:11:36 (GMT)
commit8451ebb435e3b959a036187e6aa8b18a84b42a2b (patch)
treea30d86865396a2e1fc181422b31cc68818d38618 /Tools/idle
parentd85e102337725554a43027fe90e54dd886f4ec9a (diff)
downloadcpython-8451ebb435e3b959a036187e6aa8b18a84b42a2b.zip
cpython-8451ebb435e3b959a036187e6aa8b18a84b42a2b.tar.gz
cpython-8451ebb435e3b959a036187e6aa8b18a84b42a2b.tar.bz2
Delete goodname() method, which is unused.
Add gotofileline(), a convenience method which I intend to use in a variant. Rename test() to _test().
Diffstat (limited to 'Tools/idle')
-rw-r--r--Tools/idle/FileList.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/Tools/idle/FileList.py b/Tools/idle/FileList.py
index db862a1..0a1c81a 100644
--- a/Tools/idle/FileList.py
+++ b/Tools/idle/FileList.py
@@ -24,15 +24,6 @@ class FileList:
self.inversedict = {}
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
filename = self.canonize(filename)
@@ -54,6 +45,11 @@ class FileList:
master=self.root)
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)
@@ -123,7 +119,7 @@ class FileList:
return os.path.normpath(filename)
-def test():
+def _test():
from EditorWindow import fixwordbreaks
import sys
root = Tk()
@@ -139,4 +135,4 @@ def test():
root.mainloop()
if __name__ == '__main__':
- test()
+ _test()