summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorChui Tey <chui.tey@advdata.com.au>2002-11-04 23:39:45 (GMT)
committerChui Tey <chui.tey@advdata.com.au>2002-11-04 23:39:45 (GMT)
commit69371d6530cf6a14742e3d907dcbe03de06f8406 (patch)
treec6c97b23d8afe9883cd372e68132bda2f5997761 /Lib
parent662390681e94fd4437ee000d23d042a0135aa234 (diff)
downloadcpython-69371d6530cf6a14742e3d907dcbe03de06f8406.zip
cpython-69371d6530cf6a14742e3d907dcbe03de06f8406.tar.gz
cpython-69371d6530cf6a14742e3d907dcbe03de06f8406.tar.bz2
Set breakpoints on remote debugger
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/Debugger.py2
-rw-r--r--Lib/idlelib/PyShell.py17
2 files changed, 10 insertions, 9 deletions
diff --git a/Lib/idlelib/Debugger.py b/Lib/idlelib/Debugger.py
index 27e8c2b..a0b54a3 100644
--- a/Lib/idlelib/Debugger.py
+++ b/Lib/idlelib/Debugger.py
@@ -330,7 +330,7 @@ class Debugger:
for editwin in pyshell_edit_windows:
filename = editwin.io.filename
try:
- for lineno in editwin.breakpoints:
+ for lineno in editwin.get_current_breaks():
self.set_breakpoint_here(filename, lineno)
except AttributeError:
continue
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 2b77ee3..ffd8767 100644
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -84,7 +84,7 @@ class PyShellEditorWindow(EditorWindow):
# whenever a file is changed, restore breakpoints
if self.io.filename: self.restore_file_breaks()
- def filename_changed_hook(self,old_hook=self.io.filename_change_hook):
+ def filename_changed_hook(old_hook=self.io.filename_change_hook,self=self):
self.restore_file_breaks()
old_hook()
self.io.set_filename_change_hook(filename_changed_hook)
@@ -161,18 +161,19 @@ class PyShellEditorWindow(EditorWindow):
for line in lines:
if not line.startswith(filename+"="):
new_file.write(line)
- new_file.write(filename+"="+`self.get_current_breaks()`)
+ new_file.write(filename+"="+`self.get_current_breaks()`+"\n")
new_file.close()
def restore_file_breaks(self):
self.text.update() # this enables setting "BREAK" tags to be visible
filename=self.io.filename
- lines=open(self.breakpointPath,"r").readlines()
- for line in lines:
- if line.startswith(filename+"="):
- breakpoint_linenumbers=eval(line[len(filename)+1:])
- for breakpoint_linenumber in breakpoint_linenumbers:
- self.set_breakpoint(breakpoint_linenumber)
+ if os.path.isfile(self.breakpointPath):
+ lines=open(self.breakpointPath,"r").readlines()
+ for line in lines:
+ if line.startswith(filename+"="):
+ breakpoint_linenumbers=eval(line[len(filename)+1:])
+ for breakpoint_linenumber in breakpoint_linenumbers:
+ self.set_breakpoint(breakpoint_linenumber)
def get_current_breaks(self):
#