[Python-checkins] cpython (3.4): Issue #21477: idle htests - lower case function names, other cleanups.

terry.reedy python-checkins at python.org
Tue May 20 04:56:55 CEST 2014


http://hg.python.org/cpython/rev/7c70198ec48e
changeset:   90772:7c70198ec48e
branch:      3.4
parent:      90755:854fd6eeee2f
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Mon May 19 00:12:10 2014 -0400
summary:
  Issue #21477: idle htests - lower case function names, other cleanups.

files:
  Lib/idlelib/EditorWindow.py    |  14 +++---
  Lib/idlelib/idle_test/htest.py |  39 ++++++++++-----------
  2 files changed, 26 insertions(+), 27 deletions(-)


diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -79,7 +79,7 @@
         self.parent = None
 
 helpDialog = HelpDialog()  # singleton instance
-def _Help_dialog(parent):  # wrapper for htest
+def _help_dialog(parent):  # wrapper for htest
     helpDialog.show_dialog(parent)
 
 
@@ -1702,21 +1702,21 @@
     tk.call('set', 'tcl_nonwordchars', '[^a-zA-Z0-9_]')
 
 
-def _Editor_window(parent):
+def _editor_window(parent):
     root = parent
     fixwordbreaks(root)
-    root.withdraw()
+##    root.withdraw()
     if sys.argv[1:]:
         filename = sys.argv[1]
     else:
         filename = None
     macosxSupport.setupApp(root, None)
     edit = EditorWindow(root=root, filename=filename)
-    edit.set_close_hook(root.quit)
-    edit.text.bind("<<close-all-windows>>", edit.close_event)
+##    edit.set_close_hook(root.quit)
+##    edit.text.bind("<<close-all-windows>>", edit.close_event)
 
 if __name__ == '__main__':
     from idlelib.idle_test.htest import run
     if len(sys.argv) <= 1:
-        run(_Help_dialog)
-    run(_Editor_window)
+        run(_help_dialog)
+    run(_editor_window)
diff --git a/Lib/idlelib/idle_test/htest.py b/Lib/idlelib/idle_test/htest.py
--- a/Lib/idlelib/idle_test/htest.py
+++ b/Lib/idlelib/idle_test/htest.py
@@ -13,10 +13,10 @@
 The X object must have a .__name__ attribute and a 'parent' parameter.
 X will often be a widget class, but a callable instance with .__name__
 or a wrapper function also work. The name of wrapper functions, like
-'_Editor_Window', should start with '_'.
+'_editor_Window', should start with '_'.
 
 This file must contain a matching instance of the folling template,
-with X.__name__ prepended, as in '_Editor_window_spec ...'.
+with X.__name__ prepended, as in '_editor_window_spec ...'.
 
 _spec = {
     'file': '',
@@ -33,19 +33,6 @@
 from importlib import import_module
 import tkinter as tk
 
-
-_Editor_window_spec = {
-    'file': 'EditorWindow',
-    'kwds': {},
-    'msg': "Test editor functions of interest"
-    }
-
-_Help_dialog_spec = {
-    'file': 'EditorWindow',
-    'kwds': {},
-    'msg': "If the help text displays, this works"
-    }
-
 AboutDialog_spec = {
     'file': 'aboutDialog',
     'kwds': {'title': 'About test'},
@@ -53,15 +40,27 @@
     }
 
 
+_editor_window_spec = {
+    'file': 'EditorWindow',
+    'kwds': {},
+    'msg': "Test editor functions of interest"
+    }
+
 GetCfgSectionNameDialog_spec = {
     'file': 'configSectionNameDialog',
     'kwds': {'title':'Get Name',
-                 'message':'Enter something',
-                 'used_names': {'abc'},
-                 '_htest': True},
+             'message':'Enter something',
+             'used_names': {'abc'},
+             '_htest': True},
     'msg': "After the text entered with [Ok] is stripped, <nothing>, "
-              "'abc', or more that 30 chars are errors.\n"
-              "Close 'Get Name' with a valid entry (printed to Shell), [Cancel], or [X]",
+           "'abc', or more that 30 chars are errors.\n"
+           "Close 'Get Name' with a valid entry (printed to Shell), [Cancel], or [X]",
+    }
+
+_help_dialog_spec = {
+    'file': 'EditorWindow',
+    'kwds': {},
+    'msg': "If the help text displays, this works"
     }
 
 def run(test):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list