mirror of
https://github.com/python/cpython.git
synced 2025-08-16 14:50:43 +00:00
Merged revisions 71995,72227 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r71995 | kurt.kaiser | 2009-04-26 19:22:11 -0400 (Sun, 26 Apr 2009) | 2 lines Right click 'go to file/line' not working if spaces in path. Bug 5559. ........ r72227 | kurt.kaiser | 2009-05-02 22:05:22 -0400 (Sat, 02 May 2009) | 2 lines Further development of issue5559, handle Windows files which not only have embedded spaces, but leading spaces. ........
This commit is contained in:
parent
b85c147224
commit
441dad8145
2 changed files with 16 additions and 26 deletions
|
@ -3,6 +3,9 @@ What's New in Python 2.6.4rc1
|
||||||
|
|
||||||
*Release date: XX-Oct-2009*
|
*Release date: XX-Oct-2009*
|
||||||
|
|
||||||
|
- OutputWindow/PyShell right click menu "Go to file/line" wasn't working with
|
||||||
|
file paths containing spaces. Bug 5559.
|
||||||
|
|
||||||
What's New in Python 2.6.3
|
What's New in Python 2.6.3
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
|
|
|
@ -60,9 +60,12 @@ class OutputWindow(EditorWindow):
|
||||||
]
|
]
|
||||||
|
|
||||||
file_line_pats = [
|
file_line_pats = [
|
||||||
|
# order of patterns matters
|
||||||
r'file "([^"]*)", line (\d+)',
|
r'file "([^"]*)", line (\d+)',
|
||||||
r'([^\s]+)\((\d+)\)',
|
r'([^\s]+)\((\d+)\)',
|
||||||
r'([^\s]+):\s*(\d+):',
|
r'^(\s*\S.*?):\s*(\d+):', # Win filename, maybe starting with spaces
|
||||||
|
r'([^\s]+):\s*(\d+):', # filename or path, ltrim
|
||||||
|
r'^\s*(\S.*?):\s*(\d+):', # Win abs path with embedded spaces, ltrim
|
||||||
]
|
]
|
||||||
|
|
||||||
file_line_progs = None
|
file_line_progs = None
|
||||||
|
@ -96,16 +99,16 @@ class OutputWindow(EditorWindow):
|
||||||
|
|
||||||
def _file_line_helper(self, line):
|
def _file_line_helper(self, line):
|
||||||
for prog in self.file_line_progs:
|
for prog in self.file_line_progs:
|
||||||
m = prog.search(line)
|
match = prog.search(line)
|
||||||
if m:
|
if match:
|
||||||
break
|
filename, lineno = match.group(1, 2)
|
||||||
else:
|
|
||||||
return None
|
|
||||||
filename, lineno = m.group(1, 2)
|
|
||||||
try:
|
try:
|
||||||
f = open(filename, "r")
|
f = open(filename, "r")
|
||||||
f.close()
|
f.close()
|
||||||
|
break
|
||||||
except IOError:
|
except IOError:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
return filename, int(lineno)
|
return filename, int(lineno)
|
||||||
|
@ -139,19 +142,3 @@ class OnDemandOutputWindow:
|
||||||
text.tag_configure(tag, **cnf)
|
text.tag_configure(tag, **cnf)
|
||||||
text.tag_raise('sel')
|
text.tag_raise('sel')
|
||||||
self.write = self.owin.write
|
self.write = self.owin.write
|
||||||
|
|
||||||
#class PseudoFile:
|
|
||||||
#
|
|
||||||
# def __init__(self, owin, tags, mark="end"):
|
|
||||||
# self.owin = owin
|
|
||||||
# self.tags = tags
|
|
||||||
# self.mark = mark
|
|
||||||
|
|
||||||
# def write(self, s):
|
|
||||||
# self.owin.write(s, self.tags, self.mark)
|
|
||||||
|
|
||||||
# def writelines(self, l):
|
|
||||||
# map(self.write, l)
|
|
||||||
|
|
||||||
# def flush(self):
|
|
||||||
# pass
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue