Commits

Benjamin Peterson committed 60335e4

add mapping for ttk (fixes #49)

Comments (0)

Files changed (4)

 Development version
 -------------------
 
+- Issue #49: Add six.moves mapping for tkinter.ttk.
+
 - Pull request #24: Add __dir__ special method to six.moves modules.
 
 - Issue #47: Fix add_metaclass on classes with a string for the __slots__

documentation/index.rst

 +------------------------------+-------------------------------------+-------------------------------------+
 | ``tkinter_filedialog``       | :mod:`py2:FileDialog`               | :mod:`py3:tkinter.FileDialog`       |
 +------------------------------+-------------------------------------+-------------------------------------+
-| ``tkinter_scrolledtext``     | :mod:`py2:ScrolledText`             | :mod:`py3:tkinter.scrolledtext`      |
+| ``tkinter_scrolledtext``     | :mod:`py2:ScrolledText`             | :mod:`py3:tkinter.scrolledtext`     |
 +------------------------------+-------------------------------------+-------------------------------------+
 | ``tkinter_simpledialog``     | :mod:`py2:SimpleDialog`             | :mod:`py2:tkinter.simpledialog`     |
 +------------------------------+-------------------------------------+-------------------------------------+
+| ``tkiner_ttk``               | :mod:`py2:ttk`                      | :mod:`py3:tkinter.ttk`              |
++------------------------------+-------------------------------------+-------------------------------------+
 | ``tkinter_tix``              | :mod:`py2:Tix`                      | :mod:`py3:tkinter.tix`              |
 +------------------------------+-------------------------------------+-------------------------------------+
 | ``tkinter_constants``        | :mod:`py2:Tkconstants`              | :mod:`py3:tkinter.constants`        |
     MovedModule("tkinter_scrolledtext", "ScrolledText", "tkinter.scrolledtext"),
     MovedModule("tkinter_simpledialog", "SimpleDialog", "tkinter.simpledialog"),
     MovedModule("tkinter_tix", "Tix", "tkinter.tix"),
+    MovedModule("tkinter_ttk", "ttk", "tkinter.ttk"),
     MovedModule("tkinter_constants", "Tkconstants", "tkinter.constants"),
     MovedModule("tkinter_dnd", "Tkdnd", "tkinter.dnd"),
     MovedModule("tkinter_colorchooser", "tkColorChooser",
     except ImportError:
         if item_name == "winreg" and not sys.platform.startswith("win"):
             py.test.skip("Windows only module")
-        if item_name.startswith("tkinter") and not have_tkinter:
-            py.test.skip("requires tkinter")
+        if item_name.startswith("tkinter"):
+            if not have_tkinter:
+                py.test.skip("requires tkinter")
+            if item_name == "tkinter_ttk" and sys.version_info <= (2, 6):
+                py.test.skip("ttk only available on 2.7+")
         if item_name.startswith("dbm_gnu") and not have_gdbm:
             py.test.skip("requires gdbm")
         raise