MCPcopy Index your code
hub / github.com/python/cpython / showSelectedError

Method showSelectedError

Tools/unittestgui/unittestgui.py:412–430  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

410 self.progressBar.setProgressFraction(fractionDone, fillColor)
411
412 def showSelectedError(self):
413 selection = self.errorListbox.curselection()
414 if not selection: return
415 selected = int(selection[0])
416 txt = self.errorListbox.get(selected)
417 window = tk.Toplevel(self.root)
418 window.title(txt)
419 window.protocol('WM_DELETE_WINDOW', window.quit)
420 test, error = self.errorInfo[selected]
421 tk.Label(window, text=str(test),
422 foreground="red", justify=tk.LEFT).pack(anchor=tk.W)
423 tracebackLines = traceback.format_exception(*error)
424 tracebackText = "".join(tracebackLines)
425 tk.Label(window, text=tracebackText, justify=tk.LEFT).pack()
426 tk.Button(window, text="Close",
427 command=window.quit).pack(side=tk.BOTTOM)
428 window.bind('<Key-Return>', lambda e, w=window: w.quit())
429 window.mainloop()
430 window.destroy()
431
432
433class ProgressBar(tk.Frame):

Callers 1

createWidgetsMethod · 0.95

Calls 11

strFunction · 0.85
curselectionMethod · 0.80
protocolMethod · 0.80
getMethod · 0.45
titleMethod · 0.45
packMethod · 0.45
joinMethod · 0.45
bindMethod · 0.45
quitMethod · 0.45
mainloopMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected