[Python-3000-checkins] r63418 - in python/branches/py3k/Lib: idlelib/AutoCompleteWindow.py idlelib/CallTipWindow.py idlelib/CodeContext.py idlelib/ColorDelegator.py idlelib/Debugger.py idlelib/EditorWindow.py idlelib/FileList.py idlelib/GrepDialog.py idlelib/IOBinding.py idlelib/MultiCall.py idlelib/MultiStatusBar.py idlelib/ObjectBrowser.py idlelib/OutputWindow.py idlelib/Percolator.py idlelib/PyShell.py idlelib/ReplaceDialog.py idlelib/ScriptBinding.py idlelib/ScrolledList.py idlelib/SearchDialog.py idlelib/SearchDialogBase.py idlelib/SearchEngine.py idlelib/StackViewer.py idlelib/ToolTip.py idlelib/TreeWidget.py idlelib/UndoDelegator.py idlelib/WidgetRedirector.py idlelib/WindowList.py idlelib/aboutDialog.py idlelib/configDialog.py idlelib/configHelpSourceEdit.py idlelib/configSectionNameDialog.py idlelib/dynOptionMenuWidget.py idlelib/keybindingDialog.py idlelib/macosxSupport.py idlelib/run.py idlelib/tabbedpages.py idlelib/textView.py pydoc.py tkinter/__init__.py tkinter/colorchooser.py tkinter/commondialog.py tkinter/dialog.py tkinter/dnd.py tkinter/filedialog.py tkinter/font.py tkinter/messagebox.py tkinter/scrolledtext.py tkinter/simpledialog.py tkinter/tix.py tkinter/turtle.py

georg.brandl python-3000-checkins at python.org
Sat May 17 20:39:57 CEST 2008


Author: georg.brandl
Date: Sat May 17 20:39:55 2008
New Revision: 63418

Log:
Tkinter, step 2: adapt imports.


Modified:
   python/branches/py3k/Lib/idlelib/AutoCompleteWindow.py
   python/branches/py3k/Lib/idlelib/CallTipWindow.py
   python/branches/py3k/Lib/idlelib/CodeContext.py
   python/branches/py3k/Lib/idlelib/ColorDelegator.py
   python/branches/py3k/Lib/idlelib/Debugger.py
   python/branches/py3k/Lib/idlelib/EditorWindow.py
   python/branches/py3k/Lib/idlelib/FileList.py
   python/branches/py3k/Lib/idlelib/GrepDialog.py
   python/branches/py3k/Lib/idlelib/IOBinding.py
   python/branches/py3k/Lib/idlelib/MultiCall.py
   python/branches/py3k/Lib/idlelib/MultiStatusBar.py
   python/branches/py3k/Lib/idlelib/ObjectBrowser.py
   python/branches/py3k/Lib/idlelib/OutputWindow.py
   python/branches/py3k/Lib/idlelib/Percolator.py
   python/branches/py3k/Lib/idlelib/PyShell.py
   python/branches/py3k/Lib/idlelib/ReplaceDialog.py
   python/branches/py3k/Lib/idlelib/ScriptBinding.py
   python/branches/py3k/Lib/idlelib/ScrolledList.py
   python/branches/py3k/Lib/idlelib/SearchDialog.py
   python/branches/py3k/Lib/idlelib/SearchDialogBase.py
   python/branches/py3k/Lib/idlelib/SearchEngine.py
   python/branches/py3k/Lib/idlelib/StackViewer.py
   python/branches/py3k/Lib/idlelib/ToolTip.py
   python/branches/py3k/Lib/idlelib/TreeWidget.py
   python/branches/py3k/Lib/idlelib/UndoDelegator.py
   python/branches/py3k/Lib/idlelib/WidgetRedirector.py
   python/branches/py3k/Lib/idlelib/WindowList.py
   python/branches/py3k/Lib/idlelib/aboutDialog.py
   python/branches/py3k/Lib/idlelib/configDialog.py
   python/branches/py3k/Lib/idlelib/configHelpSourceEdit.py
   python/branches/py3k/Lib/idlelib/configSectionNameDialog.py
   python/branches/py3k/Lib/idlelib/dynOptionMenuWidget.py
   python/branches/py3k/Lib/idlelib/keybindingDialog.py
   python/branches/py3k/Lib/idlelib/macosxSupport.py
   python/branches/py3k/Lib/idlelib/run.py
   python/branches/py3k/Lib/idlelib/tabbedpages.py
   python/branches/py3k/Lib/idlelib/textView.py
   python/branches/py3k/Lib/pydoc.py
   python/branches/py3k/Lib/tkinter/__init__.py
   python/branches/py3k/Lib/tkinter/colorchooser.py
   python/branches/py3k/Lib/tkinter/commondialog.py
   python/branches/py3k/Lib/tkinter/dialog.py
   python/branches/py3k/Lib/tkinter/dnd.py
   python/branches/py3k/Lib/tkinter/filedialog.py
   python/branches/py3k/Lib/tkinter/font.py
   python/branches/py3k/Lib/tkinter/messagebox.py
   python/branches/py3k/Lib/tkinter/scrolledtext.py
   python/branches/py3k/Lib/tkinter/simpledialog.py
   python/branches/py3k/Lib/tkinter/tix.py
   python/branches/py3k/Lib/tkinter/turtle.py

Modified: python/branches/py3k/Lib/idlelib/AutoCompleteWindow.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/AutoCompleteWindow.py	(original)
+++ python/branches/py3k/Lib/idlelib/AutoCompleteWindow.py	Sat May 17 20:39:55 2008
@@ -1,7 +1,7 @@
 """
 An auto-completion window for IDLE, used by the AutoComplete extension
 """
-from Tkinter import *
+from tkinter import *
 from idlelib.MultiCall import MC_SHIFT
 from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES
 

Modified: python/branches/py3k/Lib/idlelib/CallTipWindow.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/CallTipWindow.py	(original)
+++ python/branches/py3k/Lib/idlelib/CallTipWindow.py	Sat May 17 20:39:55 2008
@@ -4,7 +4,7 @@
 Used by the CallTips IDLE extension.
 
 """
-from Tkinter import *
+from tkinter import *
 
 HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
 HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")

Modified: python/branches/py3k/Lib/idlelib/CodeContext.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/CodeContext.py	(original)
+++ python/branches/py3k/Lib/idlelib/CodeContext.py	Sat May 17 20:39:55 2008
@@ -9,8 +9,8 @@
 not open blocks are not shown in the context hints pane.
 
 """
-import Tkinter
-from Tkconstants import TOP, LEFT, X, W, SUNKEN
+import tkinter
+from tkinter.constants import TOP, LEFT, X, W, SUNKEN
 import re
 from sys import maxsize as INFINITY
 from idlelib.configHandler import idleConf
@@ -69,7 +69,7 @@
             border = 0
             for widget in widgets:
                 border += int(str( widget.cget('border') ))
-            self.label = Tkinter.Label(self.editwin.top,
+            self.label = tkinter.Label(self.editwin.top,
                                        text="\n" * (self.context_depth - 1),
                                        anchor=W, justify=LEFT,
                                        font=self.textfont,

Modified: python/branches/py3k/Lib/idlelib/ColorDelegator.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/ColorDelegator.py	(original)
+++ python/branches/py3k/Lib/idlelib/ColorDelegator.py	Sat May 17 20:39:55 2008
@@ -2,7 +2,7 @@
 import re
 import keyword
 import builtins
-from Tkinter import *
+from tkinter import *
 from idlelib.Delegator import Delegator
 from idlelib.configHandler import idleConf
 

Modified: python/branches/py3k/Lib/idlelib/Debugger.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/Debugger.py	(original)
+++ python/branches/py3k/Lib/idlelib/Debugger.py	Sat May 17 20:39:55 2008
@@ -1,7 +1,7 @@
 import os
 import bdb
 import types
-from Tkinter import *
+from tkinter import *
 from idlelib.WindowList import ListedToplevel
 from idlelib.ScrolledList import ScrolledList
 from idlelib import macosxSupport

Modified: python/branches/py3k/Lib/idlelib/EditorWindow.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/EditorWindow.py	(original)
+++ python/branches/py3k/Lib/idlelib/EditorWindow.py	Sat May 17 20:39:55 2008
@@ -4,9 +4,9 @@
 import string
 import imp
 from itertools import count
-from Tkinter import *
-import tkSimpleDialog
-import tkMessageBox
+from tkinter import *
+import tkinter.simpledialog as tkSimpleDialog
+import tkinter.messagebox as tkMessageBox
 import traceback
 import webbrowser
 

Modified: python/branches/py3k/Lib/idlelib/FileList.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/FileList.py	(original)
+++ python/branches/py3k/Lib/idlelib/FileList.py	Sat May 17 20:39:55 2008
@@ -1,6 +1,6 @@
 import os
-from Tkinter import *
-import tkMessageBox
+from tkinter import *
+import tkinter.messagebox as tkMessageBox
 
 
 class FileList:

Modified: python/branches/py3k/Lib/idlelib/GrepDialog.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/GrepDialog.py	(original)
+++ python/branches/py3k/Lib/idlelib/GrepDialog.py	Sat May 17 20:39:55 2008
@@ -1,7 +1,7 @@
 import os
 import fnmatch
 import sys
-from Tkinter import *
+from tkinter import *
 from idlelib import SearchEngine
 from idlelib.SearchDialogBase import SearchDialogBase
 

Modified: python/branches/py3k/Lib/idlelib/IOBinding.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/IOBinding.py	(original)
+++ python/branches/py3k/Lib/idlelib/IOBinding.py	Sat May 17 20:39:55 2008
@@ -3,11 +3,11 @@
 import sys
 import codecs
 import tempfile
-import tkFileDialog
-import tkMessageBox
+import tkinter.filedialog as tkFileDialog
+import tkinter.messagebox as tkMessageBox
 import re
-from Tkinter import *
-from SimpleDialog import SimpleDialog
+from tkinter import *
+from tkinter.simpledialog import SimpleDialog
 
 from idlelib.configHandler import idleConf
 

Modified: python/branches/py3k/Lib/idlelib/MultiCall.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/MultiCall.py	(original)
+++ python/branches/py3k/Lib/idlelib/MultiCall.py	Sat May 17 20:39:55 2008
@@ -31,7 +31,7 @@
 
 import sys
 import re
-import Tkinter
+import tkinter
 
 # the event type constants, which define the meaning of mc_type
 MC_KEYPRESS=0; MC_KEYRELEASE=1; MC_BUTTONPRESS=2; MC_BUTTONRELEASE=3;
@@ -304,7 +304,7 @@
         return _multicall_dict[widget]
 
     class MultiCall (widget):
-        assert issubclass(widget, Tkinter.Misc)
+        assert issubclass(widget, tkinter.Misc)
 
         def __init__(self, *args, **kwargs):
             widget.__init__(self, *args, **kwargs)
@@ -396,8 +396,8 @@
 
 if __name__ == "__main__":
     # Test
-    root = Tkinter.Tk()
-    text = MultiCallCreator(Tkinter.Text)(root)
+    root = tkinter.Tk()
+    text = MultiCallCreator(tkinter.Text)(root)
     text.pack()
     def bindseq(seq, n=[0]):
         def handler(event):

Modified: python/branches/py3k/Lib/idlelib/MultiStatusBar.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/MultiStatusBar.py	(original)
+++ python/branches/py3k/Lib/idlelib/MultiStatusBar.py	Sat May 17 20:39:55 2008
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 class MultiStatusBar(Frame):
 

Modified: python/branches/py3k/Lib/idlelib/ObjectBrowser.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/ObjectBrowser.py	(original)
+++ python/branches/py3k/Lib/idlelib/ObjectBrowser.py	Sat May 17 20:39:55 2008
@@ -123,7 +123,7 @@
 
 def _test():
     import sys
-    from Tkinter import Tk
+    from tkinter import Tk
     root = Tk()
     root.configure(bd=0, bg="yellow")
     root.focus_set()

Modified: python/branches/py3k/Lib/idlelib/OutputWindow.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/OutputWindow.py	(original)
+++ python/branches/py3k/Lib/idlelib/OutputWindow.py	Sat May 17 20:39:55 2008
@@ -1,7 +1,7 @@
-from Tkinter import *
+from tkinter import *
 from idlelib.EditorWindow import EditorWindow
 import re
-import tkMessageBox
+import tkinter.messagebox as tkMessageBox
 from idlelib import IOBinding
 
 class OutputWindow(EditorWindow):

Modified: python/branches/py3k/Lib/idlelib/Percolator.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/Percolator.py	(original)
+++ python/branches/py3k/Lib/idlelib/Percolator.py	Sat May 17 20:39:55 2008
@@ -52,7 +52,7 @@
             filter.setdelegate(None)
 
 def main():
-    import Tkinter as Tk
+    import tkinter as Tk
     class Tracer(Delegator):
         def __init__(self, name):
             self.name = name

Modified: python/branches/py3k/Lib/idlelib/PyShell.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/PyShell.py	(original)
+++ python/branches/py3k/Lib/idlelib/PyShell.py	Sat May 17 20:39:55 2008
@@ -15,12 +15,12 @@
 from code import InteractiveInterpreter
 
 try:
-    from Tkinter import *
+    from tkinter import *
 except ImportError:
     print("** IDLE can't import Tkinter.  " \
           "Your Python may not be configured for Tk. **", file=sys.__stderr__)
     sys.exit(1)
-import tkMessageBox
+import tkinter.messagebox as tkMessageBox
 
 from idlelib.EditorWindow import EditorWindow, fixwordbreaks
 from idlelib.FileList import FileList
@@ -983,8 +983,8 @@
                    (sys.version, sys.platform, self.COPYRIGHT,
                     self.firewallmessage, idlever.IDLE_VERSION, nosub))
         self.showprompt()
-        import Tkinter
-        Tkinter._default_root = None # 03Jan04 KBK What's this?
+        import tkinter
+        tkinter._default_root = None # 03Jan04 KBK What's this?
         return True
 
     def readline(self):

Modified: python/branches/py3k/Lib/idlelib/ReplaceDialog.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/ReplaceDialog.py	(original)
+++ python/branches/py3k/Lib/idlelib/ReplaceDialog.py	Sat May 17 20:39:55 2008
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 from idlelib import SearchEngine
 from idlelib.SearchDialogBase import SearchDialogBase

Modified: python/branches/py3k/Lib/idlelib/ScriptBinding.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/ScriptBinding.py	(original)
+++ python/branches/py3k/Lib/idlelib/ScriptBinding.py	Sat May 17 20:39:55 2008
@@ -22,7 +22,7 @@
 import string
 import tabnanny
 import tokenize
-import tkMessageBox
+import tkinter.messagebox as tkMessageBox
 from idlelib.EditorWindow import EditorWindow
 from idlelib import PyShell
 

Modified: python/branches/py3k/Lib/idlelib/ScrolledList.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/ScrolledList.py	(original)
+++ python/branches/py3k/Lib/idlelib/ScrolledList.py	Sat May 17 20:39:55 2008
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 class ScrolledList:
 

Modified: python/branches/py3k/Lib/idlelib/SearchDialog.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/SearchDialog.py	(original)
+++ python/branches/py3k/Lib/idlelib/SearchDialog.py	Sat May 17 20:39:55 2008
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 from idlelib import SearchEngine
 from idlelib.SearchDialogBase import SearchDialogBase

Modified: python/branches/py3k/Lib/idlelib/SearchDialogBase.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/SearchDialogBase.py	(original)
+++ python/branches/py3k/Lib/idlelib/SearchDialogBase.py	Sat May 17 20:39:55 2008
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 class SearchDialogBase:
 

Modified: python/branches/py3k/Lib/idlelib/SearchEngine.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/SearchEngine.py	(original)
+++ python/branches/py3k/Lib/idlelib/SearchEngine.py	Sat May 17 20:39:55 2008
@@ -1,6 +1,6 @@
 import re
-from Tkinter import *
-import tkMessageBox
+from tkinter import *
+import tkinter.messagebox as tkMessageBox
 
 def get(root):
     if not hasattr(root, "_searchengine"):

Modified: python/branches/py3k/Lib/idlelib/StackViewer.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/StackViewer.py	(original)
+++ python/branches/py3k/Lib/idlelib/StackViewer.py	Sat May 17 20:39:55 2008
@@ -7,7 +7,7 @@
 
 def StackBrowser(root, flist=None, tb=None, top=None):
     if top is None:
-        from Tkinter import Toplevel
+        from tkinter import Toplevel
         top = Toplevel(root)
     sc = ScrolledCanvas(top, bg="white", highlightthickness=0)
     sc.frame.pack(expand=1, fill="both")

Modified: python/branches/py3k/Lib/idlelib/ToolTip.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/ToolTip.py	(original)
+++ python/branches/py3k/Lib/idlelib/ToolTip.py	Sat May 17 20:39:55 2008
@@ -3,7 +3,7 @@
 # may be useful for some purposes in (or almost in ;) the current project scope
 # Ideas gleaned from PySol
 
-from Tkinter import *
+from tkinter import *
 
 class ToolTipBase:
 

Modified: python/branches/py3k/Lib/idlelib/TreeWidget.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/TreeWidget.py	(original)
+++ python/branches/py3k/Lib/idlelib/TreeWidget.py	Sat May 17 20:39:55 2008
@@ -15,7 +15,7 @@
 # - optimize tree redraw after expand of subnode
 
 import os
-from Tkinter import *
+from tkinter import *
 import imp
 
 from idlelib import ZoomHeight

Modified: python/branches/py3k/Lib/idlelib/UndoDelegator.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/UndoDelegator.py	(original)
+++ python/branches/py3k/Lib/idlelib/UndoDelegator.py	Sat May 17 20:39:55 2008
@@ -1,5 +1,5 @@
 import string
-from Tkinter import *
+from tkinter import *
 
 from idlelib.Delegator import Delegator
 

Modified: python/branches/py3k/Lib/idlelib/WidgetRedirector.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/WidgetRedirector.py	(original)
+++ python/branches/py3k/Lib/idlelib/WidgetRedirector.py	Sat May 17 20:39:55 2008
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 class WidgetRedirector:
 

Modified: python/branches/py3k/Lib/idlelib/WindowList.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/WindowList.py	(original)
+++ python/branches/py3k/Lib/idlelib/WindowList.py	Sat May 17 20:39:55 2008
@@ -1,4 +1,4 @@
-from Tkinter import *
+from tkinter import *
 
 class WindowList:
 

Modified: python/branches/py3k/Lib/idlelib/aboutDialog.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/aboutDialog.py	(original)
+++ python/branches/py3k/Lib/idlelib/aboutDialog.py	Sat May 17 20:39:55 2008
@@ -2,7 +2,7 @@
 
 """
 
-from Tkinter import *
+from tkinter import *
 import os
 
 from idlelib import textView

Modified: python/branches/py3k/Lib/idlelib/configDialog.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/configDialog.py	(original)
+++ python/branches/py3k/Lib/idlelib/configDialog.py	Sat May 17 20:39:55 2008
@@ -9,8 +9,10 @@
 Refer to comments in EditorWindow autoindent code for details.
 
 """
-from Tkinter import *
-import tkMessageBox, tkColorChooser, tkFont
+from tkinter import *
+import tkinter.messagebox as tkMessageBox
+import tkinter.colorchooser as tkColorChooser
+import tkinter.font as tkFont
 import copy
 
 from idlelib.configHandler import idleConf

Modified: python/branches/py3k/Lib/idlelib/configHelpSourceEdit.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/configHelpSourceEdit.py	(original)
+++ python/branches/py3k/Lib/idlelib/configHelpSourceEdit.py	Sat May 17 20:39:55 2008
@@ -3,9 +3,9 @@
 import os
 import sys
 
-from Tkinter import *
-import tkMessageBox
-import tkFileDialog
+from tkinter import *
+import tkinter.messagebox as tkMessageBox
+import tkinter.filedialog as tkFileDialog
 
 class GetHelpSourceDialog(Toplevel):
     def __init__(self, parent, title, menuItem='', filePath=''):

Modified: python/branches/py3k/Lib/idlelib/configSectionNameDialog.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/configSectionNameDialog.py	(original)
+++ python/branches/py3k/Lib/idlelib/configSectionNameDialog.py	Sat May 17 20:39:55 2008
@@ -2,8 +2,8 @@
 Dialog that allows user to specify a new config file section name.
 Used to get new highlight theme and keybinding set names.
 """
-from Tkinter import *
-import tkMessageBox
+from tkinter import *
+import tkinter.messagebox as tkMessageBox
 
 class GetCfgSectionNameDialog(Toplevel):
     def __init__(self,parent,title,message,usedNames):

Modified: python/branches/py3k/Lib/idlelib/dynOptionMenuWidget.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/dynOptionMenuWidget.py	(original)
+++ python/branches/py3k/Lib/idlelib/dynOptionMenuWidget.py	Sat May 17 20:39:55 2008
@@ -2,8 +2,8 @@
 OptionMenu widget modified to allow dynamic menu reconfiguration
 and setting of highlightthickness
 """
-from Tkinter import OptionMenu
-from Tkinter import _setit
+from tkinter import OptionMenu
+from tkinter import _setit
 import copy
 
 class DynOptionMenu(OptionMenu):

Modified: python/branches/py3k/Lib/idlelib/keybindingDialog.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/keybindingDialog.py	(original)
+++ python/branches/py3k/Lib/idlelib/keybindingDialog.py	Sat May 17 20:39:55 2008
@@ -1,8 +1,8 @@
 """
 Dialog for building Tkinter accelerator key bindings
 """
-from Tkinter import *
-import tkMessageBox
+from tkinter import *
+import tkinter.messagebox as tkMessageBox
 import string
 
 class GetKeysDialog(Toplevel):

Modified: python/branches/py3k/Lib/idlelib/macosxSupport.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/macosxSupport.py	(original)
+++ python/branches/py3k/Lib/idlelib/macosxSupport.py	Sat May 17 20:39:55 2008
@@ -3,7 +3,7 @@
 GUI application (as opposed to an X11 application).
 """
 import sys
-import Tkinter
+import tkinter
 
 def runningAsOSXApp():
     """ Returns True iff running from the IDLE.app bundle on OSX """
@@ -26,7 +26,7 @@
 def hideTkConsole(root):
     try:
         root.tk.call('console', 'hide')
-    except Tkinter.TclError:
+    except tkinter.TclError:
         # Some versions of the Tk framework don't have a console object
         pass
 
@@ -46,7 +46,7 @@
     #
     # Due to a (mis-)feature of TkAqua the user will also see an empty Help
     # menu.
-    from Tkinter import Menu, Text, Text
+    from tkinter import Menu, Text, Text
     from idlelib.EditorWindow import prepstr, get_accelerator
     from idlelib import Bindings
     from idlelib import WindowList

Modified: python/branches/py3k/Lib/idlelib/run.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/run.py	(original)
+++ python/branches/py3k/Lib/idlelib/run.py	Sat May 17 20:39:55 2008
@@ -127,9 +127,9 @@
     server.handle_request() # A single request only
 
 def show_socket_error(err, address):
-    import Tkinter
-    import tkMessageBox
-    root = Tkinter.Tk()
+    import tkinter
+    import tkinter.messagebox as tkMessageBox
+    root = tkinter.Tk()
     root.withdraw()
     if err.args[0] == 61: # connection refused
         msg = "IDLE's subprocess can't connect to %s:%d.  This may be due "\

Modified: python/branches/py3k/Lib/idlelib/tabbedpages.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/tabbedpages.py	(original)
+++ python/branches/py3k/Lib/idlelib/tabbedpages.py	Sat May 17 20:39:55 2008
@@ -7,7 +7,7 @@
 TabSet -- A widget containing tabs (buttons) in one or more rows.
 
 """
-from Tkinter import *
+from tkinter import *
 
 class InvalidNameError(Exception): pass
 class AlreadyExistsError(Exception): pass

Modified: python/branches/py3k/Lib/idlelib/textView.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/textView.py	(original)
+++ python/branches/py3k/Lib/idlelib/textView.py	Sat May 17 20:39:55 2008
@@ -2,8 +2,8 @@
 
 """
 
-from Tkinter import *
-import tkMessageBox
+from tkinter import *
+import tkinter.messagebox as tkMessageBox
 
 class TextViewer(Toplevel):
     """A simple text viewer dialog for IDLE
@@ -68,7 +68,7 @@
         else:
             textFile = open(filename, 'r')
     except IOError:
-        import tkMessageBox
+        import tkinter.messagebox as tkMessageBox
         tkMessageBox.showerror(title='File Load Error',
                                message='Unable to load file %r .' % filename,
                                parent=parent)

Modified: python/branches/py3k/Lib/pydoc.py
==============================================================================
--- python/branches/py3k/Lib/pydoc.py	(original)
+++ python/branches/py3k/Lib/pydoc.py	Sat May 17 20:39:55 2008
@@ -2018,20 +2018,20 @@
             self.server = None
             self.scanner = None
 
-            import Tkinter
-            self.server_frm = Tkinter.Frame(window)
-            self.title_lbl = Tkinter.Label(self.server_frm,
+            import tkinter
+            self.server_frm = tkinter.Frame(window)
+            self.title_lbl = tkinter.Label(self.server_frm,
                 text='Starting server...\n ')
-            self.open_btn = Tkinter.Button(self.server_frm,
+            self.open_btn = tkinter.Button(self.server_frm,
                 text='open browser', command=self.open, state='disabled')
-            self.quit_btn = Tkinter.Button(self.server_frm,
+            self.quit_btn = tkinter.Button(self.server_frm,
                 text='quit serving', command=self.quit, state='disabled')
 
-            self.search_frm = Tkinter.Frame(window)
-            self.search_lbl = Tkinter.Label(self.search_frm, text='Search for')
-            self.search_ent = Tkinter.Entry(self.search_frm)
+            self.search_frm = tkinter.Frame(window)
+            self.search_lbl = tkinter.Label(self.search_frm, text='Search for')
+            self.search_ent = tkinter.Entry(self.search_frm)
             self.search_ent.bind('<Return>', self.search)
-            self.stop_btn = Tkinter.Button(self.search_frm,
+            self.stop_btn = tkinter.Button(self.search_frm,
                 text='stop', pady=0, command=self.stop, state='disabled')
             if sys.platform == 'win32':
                 # Trying to hide and show this button crashes under Windows.
@@ -2050,17 +2050,17 @@
             self.search_ent.focus_set()
 
             font = ('helvetica', sys.platform == 'win32' and 8 or 10)
-            self.result_lst = Tkinter.Listbox(window, font=font, height=6)
+            self.result_lst = tkinter.Listbox(window, font=font, height=6)
             self.result_lst.bind('<Button-1>', self.select)
             self.result_lst.bind('<Double-Button-1>', self.goto)
-            self.result_scr = Tkinter.Scrollbar(window,
+            self.result_scr = tkinter.Scrollbar(window,
                 orient='vertical', command=self.result_lst.yview)
             self.result_lst.config(yscrollcommand=self.result_scr.set)
 
-            self.result_frm = Tkinter.Frame(window)
-            self.goto_btn = Tkinter.Button(self.result_frm,
+            self.result_frm = tkinter.Frame(window)
+            self.goto_btn = tkinter.Button(self.result_frm,
                 text='go to selected', command=self.goto)
-            self.hide_btn = Tkinter.Button(self.result_frm,
+            self.hide_btn = tkinter.Button(self.result_frm,
                 text='hide results', command=self.hide)
             self.goto_btn.pack(side='left', fill='x', expand=1)
             self.hide_btn.pack(side='right', fill='x', expand=1)
@@ -2180,9 +2180,9 @@
             self.stop()
             self.collapse()
 
-    import Tkinter
+    import tkinter
     try:
-        root = Tkinter.Tk()
+        root = tkinter.Tk()
         # Tk will crash if pythonw.exe has an XP .manifest
         # file and the root has is not destroyed explicitly.
         # If the problem is ever fixed in Tk, the explicit

Modified: python/branches/py3k/Lib/tkinter/__init__.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/__init__.py	(original)
+++ python/branches/py3k/Lib/tkinter/__init__.py	Sat May 17 20:39:55 2008
@@ -18,14 +18,14 @@
 command) or with the method bind.
 
 Example (Hello, World):
-import Tkinter
-from Tkconstants import *
-tk = Tkinter.Tk()
-frame = Tkinter.Frame(tk, relief=RIDGE, borderwidth=2)
+import tkinter
+from tkinter.constants import *
+tk = tkinter.Tk()
+frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2)
 frame.pack(fill=BOTH,expand=1)
-label = Tkinter.Label(frame, text="Hello, World")
+label = tkinter.Label(frame, text="Hello, World")
 label.pack(fill=X, expand=1)
-button = Tkinter.Button(frame,text="Exit",command=tk.destroy)
+button = tkinter.Button(frame,text="Exit",command=tk.destroy)
 button.pack(side=BOTTOM)
 tk.mainloop()
 """
@@ -34,11 +34,11 @@
 
 import sys
 if sys.platform == "win32":
-    import FixTk # Attempt to configure Tcl/Tk without requiring PATH
+    # Attempt to configure Tcl/Tk without requiring PATH
+    from tkinter import _fix
 import _tkinter # If this fails your Python may not be configured for Tk
-tkinter = _tkinter # b/w compat for export
 TclError = _tkinter.TclError
-from Tkconstants import *
+from tkinter.constants import *
 try:
     import MacOS; _MacOS = MacOS; del MacOS
 except ImportError:
@@ -1692,7 +1692,7 @@
         base_tcl = os.path.join(home, '.%s.tcl' % baseName)
         base_py = os.path.join(home, '.%s.py' % baseName)
         dir = {'self': self}
-        exec('from Tkinter import *', dir)
+        exec('from tkinter import *', dir)
         if os.path.isfile(class_tcl):
             self.tk.call('source', class_tcl)
         if os.path.isfile(class_py):

Modified: python/branches/py3k/Lib/tkinter/colorchooser.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/colorchooser.py	(original)
+++ python/branches/py3k/Lib/tkinter/colorchooser.py	Sat May 17 20:39:55 2008
@@ -19,7 +19,7 @@
 # - title: dialog title
 #
 
-from tkCommonDialog import Dialog
+from tkinter.commondialog import Dialog
 
 
 #

Modified: python/branches/py3k/Lib/tkinter/commondialog.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/commondialog.py	(original)
+++ python/branches/py3k/Lib/tkinter/commondialog.py	Sat May 17 20:39:55 2008
@@ -1,14 +1,14 @@
 # base class for tk common dialogues
 #
 # this module provides a base class for accessing the common
-# dialogues available in Tk 4.2 and newer.  use tkFileDialog,
-# tkColorChooser, and tkMessageBox to access the individual
+# dialogues available in Tk 4.2 and newer.  use filedialog,
+# colorchooser, and messagebox to access the individual
 # dialogs.
 #
 # written by Fredrik Lundh, May 1997
 #
 
-from Tkinter import *
+from tkinter import *
 
 class Dialog:
 

Modified: python/branches/py3k/Lib/tkinter/dialog.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/dialog.py	(original)
+++ python/branches/py3k/Lib/tkinter/dialog.py	Sat May 17 20:39:55 2008
@@ -1,7 +1,7 @@
-# Dialog.py -- Tkinter interface to the tk_dialog script.
+# dialog.py -- Tkinter interface to the tk_dialog script.
 
-from Tkinter import *
-from Tkinter import _cnfmerge
+from tkinter import *
+from tkinter import _cnfmerge
 
 if TkVersion <= 3.6:
     DIALOG_ICON = 'warning'

Modified: python/branches/py3k/Lib/tkinter/dnd.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/dnd.py	(original)
+++ python/branches/py3k/Lib/tkinter/dnd.py	Sat May 17 20:39:55 2008
@@ -100,7 +100,7 @@
 """
 
 
-import Tkinter
+import tkinter
 
 
 # The factory function
@@ -219,7 +219,7 @@
             self.detach()
         if not canvas:
             return
-        label = Tkinter.Label(canvas, text=self.name,
+        label = tkinter.Label(canvas, text=self.name,
                               borderwidth=2, relief="raised")
         id = canvas.create_window(x, y, window=label, anchor="nw")
         self.canvas = canvas
@@ -268,8 +268,8 @@
 class Tester:
 
     def __init__(self, root):
-        self.top = Tkinter.Toplevel(root)
-        self.canvas = Tkinter.Canvas(self.top, width=100, height=100)
+        self.top = tkinter.Toplevel(root)
+        self.canvas = tkinter.Canvas(self.top, width=100, height=100)
         self.canvas.pack(fill="both", expand=1)
         self.canvas.dnd_accept = self.dnd_accept
 
@@ -300,9 +300,9 @@
         source.attach(self.canvas, x, y)
 
 def test():
-    root = Tkinter.Tk()
+    root = tkinter.Tk()
     root.geometry("+1+1")
-    Tkinter.Button(command=root.quit, text="Quit").pack()
+    tkinter.Button(command=root.quit, text="Quit").pack()
     t1 = Tester(root)
     t1.top.geometry("+1+60")
     t2 = Tester(root)

Modified: python/branches/py3k/Lib/tkinter/filedialog.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/filedialog.py	(original)
+++ python/branches/py3k/Lib/tkinter/filedialog.py	Sat May 17 20:39:55 2008
@@ -8,8 +8,8 @@
 
 """
 
-from Tkinter import *
-from Dialog import Dialog
+from tkinter import *
+from tkinter.dialog import Dialog
 
 import os
 import fnmatch

Modified: python/branches/py3k/Lib/tkinter/font.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/font.py	(original)
+++ python/branches/py3k/Lib/tkinter/font.py	Sat May 17 20:39:55 2008
@@ -8,7 +8,7 @@
 
 __version__ = "0.9"
 
-import Tkinter
+import tkinter
 
 # weight/slant
 NORMAL = "normal"
@@ -65,7 +65,7 @@
 
     def __init__(self, root=None, font=None, name=None, exists=False, **options):
         if not root:
-            root = Tkinter._default_root
+            root = tkinter._default_root
         if font:
             # get actual settings corresponding to the given font
             font = root.tk.splitlist(root.tk.call("font", "actual", font))
@@ -79,7 +79,8 @@
             self.delete_font = False
             # confirm font exists
             if self.name not in root.tk.call("font", "names"):
-                raise Tkinter._tkinter.TclError("named font %s does not already exist" % (self.name,))
+                raise tkinter._tkinter.TclError(
+                    "named font %s does not already exist" % (self.name,))
             # if font config info supplied, apply it
             if font:
                 root.tk.call("font", "configure", self.name, *font)
@@ -166,13 +167,13 @@
 def families(root=None):
     "Get font families (as a tuple)"
     if not root:
-        root = Tkinter._default_root
+        root = tkinter._default_root
     return root.tk.splitlist(root.tk.call("font", "families"))
 
 def names(root=None):
     "Get names of defined fonts (as a tuple)"
     if not root:
-        root = Tkinter._default_root
+        root = tkinter._default_root
     return root.tk.splitlist(root.tk.call("font", "names"))
 
 # --------------------------------------------------------------------
@@ -180,7 +181,7 @@
 
 if __name__ == "__main__":
 
-    root = Tkinter.Tk()
+    root = tkinter.Tk()
 
     # create a font
     f = Font(family="times", size=30, weight=NORMAL)
@@ -202,10 +203,10 @@
     f = Font(font=("Courier", 20, "bold"))
     print(f.measure("hello"), f.metrics("linespace"))
 
-    w = Tkinter.Label(root, text="Hello, world", font=f)
+    w = tkinter.Label(root, text="Hello, world", font=f)
     w.pack()
 
-    w = Tkinter.Button(root, text="Quit!", command=root.destroy)
+    w = tkinter.Button(root, text="Quit!", command=root.destroy)
     w.pack()
 
     fb = Font(font=w["font"]).copy()
@@ -213,4 +214,4 @@
 
     w.config(font=fb)
 
-    Tkinter.mainloop()
+    tkinter.mainloop()

Modified: python/branches/py3k/Lib/tkinter/messagebox.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/messagebox.py	(original)
+++ python/branches/py3k/Lib/tkinter/messagebox.py	Sat May 17 20:39:55 2008
@@ -22,7 +22,7 @@
 # - type: dialog type; that is, which buttons to display (see below)
 #
 
-from tkCommonDialog import Dialog
+from tkinter.commondialog import Dialog
 
 #
 # constants

Modified: python/branches/py3k/Lib/tkinter/scrolledtext.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/scrolledtext.py	(original)
+++ python/branches/py3k/Lib/tkinter/scrolledtext.py	Sat May 17 20:39:55 2008
@@ -10,8 +10,8 @@
 # Most methods calls are inherited from the Text widget; Pack methods
 # are redirected to the Frame widget however.
 
-from Tkinter import *
-from Tkinter import _cnfmerge
+from tkinter import *
+from tkinter import _cnfmerge
 
 class ScrolledText(Text):
     def __init__(self, master=None, cnf=None, **kw):

Modified: python/branches/py3k/Lib/tkinter/simpledialog.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/simpledialog.py	(original)
+++ python/branches/py3k/Lib/tkinter/simpledialog.py	Sat May 17 20:39:55 2008
@@ -1,7 +1,7 @@
 """A simple but flexible modal dialog box."""
 
 
-from Tkinter import *
+from tkinter import *
 
 
 class SimpleDialog:

Modified: python/branches/py3k/Lib/tkinter/tix.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/tix.py	(original)
+++ python/branches/py3k/Lib/tkinter/tix.py	Sat May 17 20:39:55 2008
@@ -26,8 +26,8 @@
 # appreciate the advantages.
 #
 
-from Tkinter import *
-from Tkinter import _flatten, _cnfmerge, _default_root
+from tkinter import *
+from tkinter import _flatten, _cnfmerge, _default_root
 
 # WARNING - TkVersion is a limited precision floating point number
 if TkVersion < 3.999:
@@ -57,7 +57,7 @@
 # BEWARE - this is implemented by copying some code from the Widget class
 #          in Tkinter (to override Widget initialization) and is therefore
 #          liable to break.
-import Tkinter, os
+import tkinter, os
 
 # Could probably add this to Tkinter.Misc
 class tixCommand:
@@ -192,11 +192,11 @@
         else:
             return self.tk.call('tix', 'resetoptions', newScheme, newFontSet)
 
-class Tk(Tkinter.Tk, tixCommand):
+class Tk(tkinter.Tk, tixCommand):
     """Toplevel widget of Tix which represents mostly the main window
     of an application. It has an associated Tcl interpreter."""
     def __init__(self, screenName=None, baseName=None, className='Tix'):
-        Tkinter.Tk.__init__(self, screenName, baseName, className)
+        tkinter.Tk.__init__(self, screenName, baseName, className)
         tixlib = os.environ.get('TIX_LIBRARY')
         self.tk.eval('global auto_path; lappend auto_path [file dir [info nameof]]')
         if tixlib is not None:
@@ -212,7 +212,7 @@
     def destroy(self):
         # For safety, remove an delete_window binding before destroy
         self.protocol("WM_DELETE_WINDOW", "")
-        Tkinter.Tk.destroy(self)
+        tkinter.Tk.destroy(self)
 
 # The Tix 'tixForm' geometry manager
 class Form:
@@ -260,9 +260,9 @@
 
 
 
-Tkinter.Widget.__bases__ = Tkinter.Widget.__bases__ + (Form,)
+tkinter.Widget.__bases__ = tkinter.Widget.__bases__ + (Form,)
 
-class TixWidget(Tkinter.Widget):
+class TixWidget(tkinter.Widget):
     """A TixWidget class is used to package all (or most) Tix widgets.
 
     Widget initialization is extended in two ways:
@@ -383,7 +383,7 @@
     # These are missing from Tkinter
     def image_create(self, imgtype, cnf={}, master=None, **kw):
         if not master:
-            master = Tkinter._default_root
+            master = tkinter._default_root
             if not master:
                 raise RuntimeError('Too early to create image')
         if kw and cnf: cnf = _cnfmerge((cnf, kw))

Modified: python/branches/py3k/Lib/tkinter/turtle.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/turtle.py	(original)
+++ python/branches/py3k/Lib/tkinter/turtle.py	Sat May 17 20:39:55 2008
@@ -16,7 +16,7 @@
 
 from math import * # Also for export
 from time import sleep
-import Tkinter
+import tkinter
 
 speeds = ['fastest', 'fast', 'normal', 'slow', 'slowest']
 
@@ -238,7 +238,7 @@
                 # Test the color first
                 try:
                     id = self._canvas.create_line(0, 0, 0, 0, fill=color)
-                except Tkinter.TclError:
+                except tkinter.TclError:
                     raise Error("bad color string: %r" % (color,))
                 self._set_color(color)
                 return
@@ -554,7 +554,7 @@
                     # in case nhops==0
                     self._canvas.coords(item, x0, y0, x1, y1)
                     self._canvas.itemconfigure(item, arrow="none")
-                except Tkinter.TclError:
+                except tkinter.TclError:
                     # Probably the window was closed!
                     return
             else:
@@ -638,13 +638,13 @@
     def __init__(self):
         global _root, _canvas
         if _root is None:
-            _root = Tkinter.Tk()
+            _root = tkinter.Tk()
             _root.wm_protocol("WM_DELETE_WINDOW", self._destroy)
             _root.title(_title)
 
         if _canvas is None:
             # XXX Should have scroll bars
-            _canvas = Tkinter.Canvas(_root, background="white")
+            _canvas = tkinter.Canvas(_root, background="white")
             _canvas.pack(expand=1, fill="both")
 
             setup(width=_width, height= _height, startx=_startx, starty=_starty)


More information about the Python-3000-checkins mailing list