mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Make the Pynche tool work with Python 3.
This commit is contained in:
parent
1800934285
commit
bf76ce168c
8 changed files with 32 additions and 28 deletions
|
|
@ -6,9 +6,8 @@ It is used to bring up other windows.
|
|||
|
||||
import sys
|
||||
import os
|
||||
from Tkinter import *
|
||||
import tkMessageBox
|
||||
import tkFileDialog
|
||||
from tkinter import *
|
||||
from tkinter import messagebox, filedialog
|
||||
import ColorDB
|
||||
|
||||
# Milliseconds between interrupt checks
|
||||
|
|
@ -150,7 +149,7 @@ class PyncheWidget:
|
|||
|
||||
def __popup_about(self, event=None):
|
||||
from Main import __version__
|
||||
tkMessageBox.showinfo('About Pynche ' + __version__,
|
||||
messagebox.showinfo('About Pynche ' + __version__,
|
||||
'''\
|
||||
Pynche %s
|
||||
The PYthonically Natural
|
||||
|
|
@ -168,7 +167,7 @@ email: bwarsaw@python.org''' % __version__)
|
|||
def __load(self, event=None):
|
||||
while 1:
|
||||
idir, ifile = os.path.split(self.__sb.colordb().filename())
|
||||
file = tkFileDialog.askopenfilename(
|
||||
file = filedialog.askopenfilename(
|
||||
filetypes=[('Text files', '*.txt'),
|
||||
('All files', '*'),
|
||||
],
|
||||
|
|
@ -180,12 +179,12 @@ email: bwarsaw@python.org''' % __version__)
|
|||
try:
|
||||
colordb = ColorDB.get_colordb(file)
|
||||
except IOError:
|
||||
tkMessageBox.showerror('Read error', '''\
|
||||
messagebox.showerror('Read error', '''\
|
||||
Could not open file for reading:
|
||||
%s''' % file)
|
||||
continue
|
||||
if colordb is None:
|
||||
tkMessageBox.showerror('Unrecognized color file type', '''\
|
||||
messagebox.showerror('Unrecognized color file type', '''\
|
||||
Unrecognized color file type in file:
|
||||
%s''' % file)
|
||||
continue
|
||||
|
|
@ -249,6 +248,8 @@ class Helpwin:
|
|||
|
||||
|
||||
|
||||
import functools
|
||||
@functools.total_ordering
|
||||
class PopupViewer:
|
||||
def __init__(self, module, name, switchboard, root):
|
||||
self.__m = module
|
||||
|
|
@ -279,8 +280,11 @@ class PopupViewer:
|
|||
self.__sb.add_view(self.__window)
|
||||
self.__window.deiconify()
|
||||
|
||||
def __cmp__(self, other):
|
||||
return cmp(self.__menutext, other.__menutext)
|
||||
def __eq__(self, other):
|
||||
return self.__menutext == other.__menutext
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.__menutext < other.__menutext
|
||||
|
||||
|
||||
def make_view_popups(switchboard, root, extrapath):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue