summaryrefslogtreecommitdiffstats
path: root/Tools/pynche/PyncheWidget.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/pynche/PyncheWidget.py')
-rw-r--r--Tools/pynche/PyncheWidget.py26
1 files changed, 9 insertions, 17 deletions
diff --git a/Tools/pynche/PyncheWidget.py b/Tools/pynche/PyncheWidget.py
index ef12198..fcfe7ce 100644
--- a/Tools/pynche/PyncheWidget.py
+++ b/Tools/pynche/PyncheWidget.py
@@ -6,8 +6,9 @@ It is used to bring up other windows.
import sys
import os
-from tkinter import *
-from tkinter import messagebox, filedialog
+from Tkinter import *
+import tkMessageBox
+import tkFileDialog
import ColorDB
# Milliseconds between interrupt checks
@@ -149,7 +150,7 @@ class PyncheWidget:
def __popup_about(self, event=None):
from Main import __version__
- messagebox.showinfo('About Pynche ' + __version__,
+ tkMessageBox.showinfo('About Pynche ' + __version__,
'''\
Pynche %s
The PYthonically Natural
@@ -167,7 +168,7 @@ email: bwarsaw@python.org''' % __version__)
def __load(self, event=None):
while 1:
idir, ifile = os.path.split(self.__sb.colordb().filename())
- file = filedialog.askopenfilename(
+ file = tkFileDialog.askopenfilename(
filetypes=[('Text files', '*.txt'),
('All files', '*'),
],
@@ -179,12 +180,12 @@ email: bwarsaw@python.org''' % __version__)
try:
colordb = ColorDB.get_colordb(file)
except IOError:
- messagebox.showerror('Read error', '''\
+ tkMessageBox.showerror('Read error', '''\
Could not open file for reading:
%s''' % file)
continue
if colordb is None:
- messagebox.showerror('Unrecognized color file type', '''\
+ tkMessageBox.showerror('Unrecognized color file type', '''\
Unrecognized color file type in file:
%s''' % file)
continue
@@ -248,8 +249,6 @@ class Helpwin:
-import functools
-@functools.total_ordering
class PopupViewer:
def __init__(self, module, name, switchboard, root):
self.__m = module
@@ -280,15 +279,8 @@ class PopupViewer:
self.__sb.add_view(self.__window)
self.__window.deiconify()
- def __eq__(self, other):
- if isinstance(self, PopupViewer):
- return self.__menutext == other.__menutext
- return NotImplemented
-
- def __lt__(self, other):
- if isinstance(self, PopupViewer):
- return self.__menutext < other.__menutext
- return NotImplemented
+ def __cmp__(self, other):
+ return cmp(self.__menutext, other.__menutext)
def make_view_popups(switchboard, root, extrapath):