Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
idlelib.Debugger.StackViewer Class Reference
Inheritance diagram for idlelib.Debugger.StackViewer:
Inheritance graph
[legend]
Collaboration diagram for idlelib.Debugger.StackViewer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def load_stack
def popup_event
def fill_menu
def on_select
def on_double
def goto_source_line
def show_stack_frame
def show_source
def close
def clear
def append
def get
def click_event
def double_click_event
def make_menu
def up_event
def down_event
def select

Public Attributes

 flist
 gui
 stack
 master
 frame
 vbar
 listbox
 empty

Static Public Attributes

string default = "(None)"
 menu = None

Detailed Description

Definition at line 323 of file Debugger.py.


Constructor & Destructor Documentation

def idlelib.Debugger.StackViewer.__init__ (   self,
  master,
  flist,
  gui 
)

Definition at line 325 of file Debugger.py.

00325 
00326     def __init__(self, master, flist, gui):
00327         if macosxSupport.runningAsOSXApp():
00328             # At least on with the stock AquaTk version on OSX 10.4 you'll
00329             # get an shaking GUI that eventually kills IDLE if the width
00330             # argument is specified.
00331             ScrolledList.__init__(self, master)
00332         else:
00333             ScrolledList.__init__(self, master, width=80)
00334         self.flist = flist
00335         self.gui = gui
00336         self.stack = []

Here is the caller graph for this function:


Member Function Documentation

def idlelib.ScrolledList.ScrolledList.append (   self,
  item 
) [inherited]

Definition at line 39 of file ScrolledList.py.

00039 
00040     def append(self, item):
00041         if self.empty:
00042             self.listbox.delete(0, "end")
00043             self.empty = 0
00044         self.listbox.insert("end", str(item))

Here is the caller graph for this function:

def idlelib.ScrolledList.ScrolledList.clear (   self) [inherited]

Definition at line 34 of file ScrolledList.py.

00034 
00035     def clear(self):
00036         self.listbox.delete(0, "end")
00037         self.empty = 1
00038         self.listbox.insert("end", self.default)

Here is the caller graph for this function:

def idlelib.ScrolledList.ScrolledList.click_event (   self,
  event 
) [inherited]

Definition at line 48 of file ScrolledList.py.

00048 
00049     def click_event(self, event):
00050         self.listbox.activate("@%d,%d" % (event.x, event.y))
00051         index = self.listbox.index("active")
00052         self.select(index)
00053         self.on_select(index)
00054         return "break"

Here is the call graph for this function:

def idlelib.ScrolledList.ScrolledList.close (   self) [inherited]

Definition at line 31 of file ScrolledList.py.

00031 
00032     def close(self):
00033         self.frame.destroy()

Here is the caller graph for this function:

def idlelib.ScrolledList.ScrolledList.double_click_event (   self,
  event 
) [inherited]

Definition at line 55 of file ScrolledList.py.

00055 
00056     def double_click_event(self, event):
00057         index = self.listbox.index("active")
00058         self.select(index)
00059         self.on_double(index)
00060         return "break"

Here is the call graph for this function:

def idlelib.ScrolledList.ScrolledList.down_event (   self,
  event 
) [inherited]

Definition at line 90 of file ScrolledList.py.

00090 
00091     def down_event(self, event):
00092         index = self.listbox.index("active")
00093         if self.listbox.selection_includes(index):
00094             index = index + 1
00095         else:
00096             index = 0
00097         if index >= self.listbox.size():
00098             self.listbox.bell()
00099         else:
00100             self.select(index)
00101             self.on_select(index)
00102         return "break"

Here is the call graph for this function:

Reimplemented from idlelib.ScrolledList.ScrolledList.

Definition at line 368 of file Debugger.py.

00368 
00369     def fill_menu(self):
00370         "override base method"
00371         menu = self.menu
00372         menu.add_command(label="Go to source line",
00373                          command=self.goto_source_line)
00374         menu.add_command(label="Show stack frame",
00375                          command=self.show_stack_frame)

Here is the call graph for this function:

Here is the caller graph for this function:

def idlelib.ScrolledList.ScrolledList.get (   self,
  index 
) [inherited]

Definition at line 45 of file ScrolledList.py.

00045 
00046     def get(self, index):
00047         return self.listbox.get(index)

Here is the caller graph for this function:

Definition at line 385 of file Debugger.py.

00385 
00386     def goto_source_line(self):
00387         index = self.listbox.index("active")
00388         self.show_source(index)

Here is the call graph for this function:

Here is the caller graph for this function:

def idlelib.Debugger.StackViewer.load_stack (   self,
  stack,
  index = None 
)

Definition at line 337 of file Debugger.py.

00337 
00338     def load_stack(self, stack, index=None):
00339         self.stack = stack
00340         self.clear()
00341         for i in range(len(stack)):
00342             frame, lineno = stack[i]
00343             try:
00344                 modname = frame.f_globals["__name__"]
00345             except:
00346                 modname = "?"
00347             code = frame.f_code
00348             filename = code.co_filename
00349             funcname = code.co_name
00350             import linecache
00351             sourceline = linecache.getline(filename, lineno)
00352             sourceline = sourceline.strip()
00353             if funcname in ("?", "", None):
00354                 item = "%s, line %d: %s" % (modname, lineno, sourceline)
00355             else:
00356                 item = "%s.%s(), line %d: %s" % (modname, funcname,
00357                                                  lineno, sourceline)
00358             if i == index:
00359                 item = "> " + item
00360             self.append(item)
00361         if index is not None:
00362             self.select(index)

Here is the call graph for this function:

def idlelib.ScrolledList.ScrolledList.make_menu (   self) [inherited]

Definition at line 72 of file ScrolledList.py.

00072 
00073     def make_menu(self):
00074         menu = Menu(self.listbox, tearoff=0)
00075         self.menu = menu
00076         self.fill_menu()

Here is the call graph for this function:

Here is the caller graph for this function:

def idlelib.Debugger.StackViewer.on_double (   self,
  index 
)

Reimplemented from idlelib.ScrolledList.ScrolledList.

Definition at line 381 of file Debugger.py.

00381 
00382     def on_double(self, index):
00383         "override base method"
00384         self.show_source(index)

Here is the call graph for this function:

Here is the caller graph for this function:

def idlelib.Debugger.StackViewer.on_select (   self,
  index 
)

Reimplemented from idlelib.ScrolledList.ScrolledList.

Definition at line 376 of file Debugger.py.

00376 
00377     def on_select(self, index):
00378         "override base method"
00379         if 0 <= index < len(self.stack):
00380             self.gui.show_frame(self.stack[index])

Here is the caller graph for this function:

def idlelib.Debugger.StackViewer.popup_event (   self,
  event 
)

Reimplemented from idlelib.ScrolledList.ScrolledList.

Definition at line 363 of file Debugger.py.

00363 
00364     def popup_event(self, event):
00365         "override base method"
00366         if self.stack:
00367             return ScrolledList.popup_event(self, event)

def idlelib.ScrolledList.ScrolledList.select (   self,
  index 
) [inherited]

Definition at line 103 of file ScrolledList.py.

00103 
00104     def select(self, index):
00105         self.listbox.focus_set()
00106         self.listbox.activate(index)
00107         self.listbox.selection_clear(0, "end")
00108         self.listbox.selection_set(index)
00109         self.listbox.see(index)

Here is the caller graph for this function:

def idlelib.Debugger.StackViewer.show_source (   self,
  index 
)

Definition at line 394 of file Debugger.py.

00394 
00395     def show_source(self, index):
00396         if not (0 <= index < len(self.stack)):
00397             return
00398         frame, lineno = self.stack[index]
00399         code = frame.f_code
00400         filename = code.co_filename
00401         if os.path.isfile(filename):
00402             edit = self.flist.open(filename)
00403             if edit:
00404                 edit.gotoline(lineno)
00405 

Here is the caller graph for this function:

Definition at line 389 of file Debugger.py.

00389 
00390     def show_stack_frame(self):
00391         index = self.listbox.index("active")
00392         if 0 <= index < len(self.stack):
00393             self.gui.show_frame(self.stack[index])

Here is the caller graph for this function:

def idlelib.ScrolledList.ScrolledList.up_event (   self,
  event 
) [inherited]

Definition at line 77 of file ScrolledList.py.

00077 
00078     def up_event(self, event):
00079         index = self.listbox.index("active")
00080         if self.listbox.selection_includes(index):
00081             index = index - 1
00082         else:
00083             index = self.listbox.size() - 1
00084         if index < 0:
00085             self.listbox.bell()
00086         else:
00087             self.select(index)
00088             self.on_select(index)
00089         return "break"

Here is the call graph for this function:


Member Data Documentation

string idlelib.ScrolledList.ScrolledList.default = "(None)" [static, inherited]

Definition at line 5 of file ScrolledList.py.

Definition at line 36 of file ScrolledList.py.

Definition at line 333 of file Debugger.py.

Definition at line 10 of file ScrolledList.py.

Definition at line 334 of file Debugger.py.

Definition at line 14 of file ScrolledList.py.

Definition at line 9 of file ScrolledList.py.

idlelib.ScrolledList.ScrolledList.menu = None [static, inherited]

Definition at line 61 of file ScrolledList.py.

Definition at line 335 of file Debugger.py.

Definition at line 12 of file ScrolledList.py.


The documentation for this class was generated from the following file: