Mostly double spacing before 'if __name__...'.
class Nested_in_closure: pass
ModuleBrowser(parent, file, _htest=True)
+
if __name__ == "__main__":
if len(sys.argv) == 1: # If pass file on command line, unittest fails.
from unittest import main
text.focus_set()
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_calltip_w', verbosity=2, exit=False)
dumpCfg(idleConf.userCfg)
print('\nlines = ', line, ', crc = ', crc, sep='')
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_config', verbosity=2, exit=False)
node = TreeNode(sc.canvas, None, item)
node.update()
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_debugobj', verbosity=2, exit=False)
self.resetcache()
self.delegate = delegate
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_delegator', verbosity=2)
if value:
self.variable.set(value)
+
def _dyn_option_menu(parent): # htest #
from tkinter import Toplevel # + StringVar, Button
button = Button(top, text="Change option set", command=update)
button.pack()
+
if __name__ == '__main__':
# Only module without unittests because of intention to replace.
from idlelib.idle_test.htest import run
# Does not stop error, neither does following
# edit.text.bind("<<close-window>>", edit.close_event)
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_editor', verbosity=2, exit=False)
if flist.inversedict:
root.mainloop()
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_filelist', verbosity=2)
frame.pack()
text = Text(frame, height=5)
text.pack()
+ text.insert('1.0', 'import grep')
def show_grep_dialog():
- text.tag_add(SEL, "1.0", END)
+ text.tag_add(SEL, "1.0", '1.end')
grep(text, flist=flist)
- text.tag_remove(SEL, "1.0", END)
+ text.tag_remove(SEL, "1.0", '1.end')
button = Button(frame, text="Show GrepDialog", command=show_grep_dialog)
button.pack()
+
if __name__ == "__main__":
from unittest import main
main('idlelib.idle_test.test_grep', verbosity=2, exit=False)
out.write(line.rstrip() + b'\n')
print(f'{src} copied to {dst}')
+
def _helpwindow(parent):
"Create HelpWindow; called from Idle Help event handler."
filename = join(abspath(dirname(__file__)), 'help.html')
return
HelpWindow(parent, filename, 'IDLE Help (%s)' % python_version())
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_help', verbosity=2, exit=False)
'msg': "Click the 'Show GrepDialog' button.\n"
"Test the various 'Find-in-files' functions.\n"
"The results should be displayed in a new '*Output*' window.\n"
- "'Right-click'->'Go to file/line' anywhere in the search results "
- "should open that file \nin a new EditorWindow."
+ "'Right-click'->'Go to file/line' in the search results\n "
+ "should open that file in a new EditorWindow."
}
HelpSource_spec = {
"Check that changes were saved by opening the file elsewhere."
}
-_linenumbers_drag_scrolling_spec = {
- 'file': 'sidebar',
- 'kwds': {},
- 'msg': textwrap.dedent("""\
- 1. Click on the line numbers and drag down below the edge of the
- window, moving the mouse a bit and then leaving it there for a
- while. The text and line numbers should gradually scroll down,
- with the selection updated continuously.
-
- 2. With the lines still selected, click on a line number above
- or below the selected lines. Only the line whose number was
- clicked should be selected.
-
- 3. Repeat step #1, dragging to above the window. The text and
- line numbers should gradually scroll up, with the selection
- updated continuously.
-
- 4. Repeat step #2, clicking a line number below the selection."""),
- }
-
_multi_call_spec = {
'file': 'multicall',
'kwds': {},
"Click [Close] or [X] to close the 'Replace Dialog'."
}
+_scrolled_list_spec = {
+ 'file': 'scrolledlist',
+ 'kwds': {},
+ 'msg': "You should see a scrollable list of items\n"
+ "Selecting (clicking) or double clicking an item "
+ "prints the name to the console or Idle shell.\n"
+ "Right clicking an item will display a popup."
+ }
+
_search_dialog_spec = {
'file': 'search',
'kwds': {},
"Its only action is to close."
}
-_scrolled_list_spec = {
- 'file': 'scrolledlist',
+_sidebar_number_scrolling_spec = {
+ 'file': 'sidebar',
'kwds': {},
- 'msg': "You should see a scrollable list of items\n"
- "Selecting (clicking) or double clicking an item "
- "prints the name to the console or Idle shell.\n"
- "Right clicking an item will display a popup."
+ 'msg': textwrap.dedent("""\
+ 1. Click on the line numbers and drag down below the edge of the
+ window, moving the mouse a bit and then leaving it there for a
+ while. The text and line numbers should gradually scroll down,
+ with the selection updated continuously.
+
+ 2. With the lines still selected, click on a line number above
+ or below the selected lines. Only the line whose number was
+ clicked should be selected.
+
+ 3. Repeat step #1, dragging to above the window. The text and
+ line numbers should gradually scroll up, with the selection
+ updated continuously.
+
+ 4. Repeat step #2, clicking a line number below the selection."""),
}
_stackbrowser_spec = {
'file': 'stackviewer',
'kwds': {},
'msg': "A stacktrace for a NameError exception.\n"
- "Expand 'idlelib ...' and '<locals>'.\n"
- "Check that exc_value, exc_tb, and exc_type are correct.\n"
+ "Should have NameError and 1 traceback line."
}
_tooltip_spec = {
next_test()
root.mainloop()
+
if __name__ == '__main__':
run()
if self.editwin.flist:
self.editwin.update_recent_files_list(filename)
+
def _io_binding(parent): # htest #
from tkinter import Toplevel, Text
editwin = MyEditWin(text)
IOBinding(editwin)
+
if __name__ == "__main__":
from unittest import main
main('idlelib.idle_test.test_iomenu', verbosity=2, exit=False)
bindseq("<Enter>")
bindseq("<Leave>")
+
if __name__ == "__main__":
from unittest import main
main('idlelib.idle_test.test_mainmenu', verbosity=2, exit=False)
text.tag_raise('sel')
self.write = self.owin.write
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_outwin', verbosity=2, exit=False)
(pin if var2.get() else pout)(t2)
text.pack()
+ text.focus_set()
var1 = tk.IntVar(parent)
cb1 = tk.Checkbutton(top, text="Tracer1", command=toggle1, variable=var1)
cb1.pack()
cb2 = tk.Checkbutton(top, text="Tracer2", command=toggle2, variable=var2)
cb2.pack()
+
if __name__ == "__main__":
from unittest import main
main('idlelib.idle_test.test_percolator', verbosity=2, exit=False)
root.destroy()
capture_warnings(False)
+
if __name__ == "__main__":
main()
original_insert(*args)
original_insert = redir.register("insert", my_insert)
+
if __name__ == "__main__":
from unittest import main
main('idlelib.idle_test.test_redirector', verbosity=2, exit=False)
button = Button(frame, text="Replace", command=show_replace)
button.pack()
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_replace', verbosity=2, exit=False)
for i in range(30):
scrolled_list.append("Item %02d" % i)
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_scrolledlist', verbosity=2, exit=False)
button = Button(frame, text="Search (selection ignored)", command=show_find)
button.pack()
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_search', verbosity=2, exit=False)
self.change_callback()
-def _linenumbers_drag_scrolling(parent): # htest #
+def _sidebar_number_scrolling(parent): # htest #
from idlelib.idle_test.test_sidebar import Dummy_editwin
top = tk.Toplevel(parent)
main('idlelib.idle_test.test_sidebar', verbosity=2, exit=False)
from idlelib.idle_test.htest import run
- run(_linenumbers_drag_scrolling)
+ run(_sidebar_number_scrolling)
button.pack(side='bottom')
frame.pack()
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_statusbar', verbosity=2, exit=False)
node = TreeNode(sc.canvas, None, item)
node.expand()
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_tree', verbosity=2, exit=False)
dump = Button(top, text="Dump", command=lambda:d.dump_event(None))
dump.pack(side='left')
+
if __name__ == "__main__":
from unittest import main
main('idlelib.idle_test.test_undo', verbosity=2, exit=False)
# .pyw is for Windows; .pyi is for stub files.
py_extensions = ('.py', '.pyw', '.pyi') # Order needed for open/save dialogs.
+
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_util', verbosity=2)