Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df8a40f

Browse files
committed
py-cvs-2000_07_13 (Rev 1.9) merge
"Delete goodname() method, which is unused. Add gotofileline(), a convenience method which I intend to use in a variant. Rename test() to _test()." --GvR This was an interesting merge. The join completely missed removing goodname(), which was adjacent, but outside of, a small conflict. I only caught it by comparing the 1.1.3.2/1.1.3.3 diff. CVS ain't infallible.
1 parent fd182cd commit df8a40f

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

Lib/idlelib/FileList.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ def __init__(self, root):
2929
self.inversedict = {}
3030
self.vars = {} # For EditorWindow.getrawvar (shared Tcl variables)
3131

32-
33-
def goodname(self, filename):
34-
filename = self.canonize(filename)
35-
key = os.path.normcase(filename)
36-
if self.dict.has_key(key):
37-
edit = self.dict[key]
38-
filename = edit.io.filename or filename
39-
return filename
40-
4132
def open(self, filename, action=None):
4233
assert filename
4334
filename = self.canonize(filename)
@@ -62,6 +53,11 @@ def open(self, filename, action=None):
6253
else:
6354
return action(filename)
6455

56+
def gotofileline(self, filename, lineno=None):
57+
edit = self.open(filename)
58+
if edit is not None and lineno is not None:
59+
edit.gotoline(lineno)
60+
6561
def new(self):
6662
return self.EditorWindow(self)
6763

@@ -131,7 +127,7 @@ def canonize(self, filename):
131127
return os.path.normpath(filename)
132128

133129

134-
def test():
130+
def _test():
135131
from EditorWindow import fixwordbreaks
136132
import sys
137133
root = Tk()
@@ -147,4 +143,4 @@ def test():
147143
root.mainloop()
148144

149145
if __name__ == '__main__':
150-
test()
146+
_test()

0 commit comments

Comments
 (0)