Move imports to file top.

This commit is contained in:
Georg Brandl 2008-05-17 15:30:35 +00:00
parent 8291f8efae
commit a9c205dd46
1 changed files with 6 additions and 6 deletions

View File

@ -254,8 +254,8 @@ class _QueryDialog(Dialog):
parent = None): parent = None):
if not parent: if not parent:
import Tkinter import tkinter
parent = Tkinter._default_root parent = tkinter._default_root
self.prompt = prompt self.prompt = prompt
self.minvalue = minvalue self.minvalue = minvalue
@ -285,12 +285,12 @@ class _QueryDialog(Dialog):
def validate(self): def validate(self):
import tkMessageBox from tkinter import messagebox
try: try:
result = self.getresult() result = self.getresult()
except ValueError: except ValueError:
tkMessageBox.showwarning( messagebox.showwarning(
"Illegal value", "Illegal value",
self.errormessage + "\nPlease try again", self.errormessage + "\nPlease try again",
parent = self parent = self
@ -298,7 +298,7 @@ class _QueryDialog(Dialog):
return 0 return 0
if self.minvalue is not None and result < self.minvalue: if self.minvalue is not None and result < self.minvalue:
tkMessageBox.showwarning( messagebox.showwarning(
"Too small", "Too small",
"The allowed minimum value is %s. " "The allowed minimum value is %s. "
"Please try again." % self.minvalue, "Please try again." % self.minvalue,
@ -307,7 +307,7 @@ class _QueryDialog(Dialog):
return 0 return 0
if self.maxvalue is not None and result > self.maxvalue: if self.maxvalue is not None and result > self.maxvalue:
tkMessageBox.showwarning( messagebox.showwarning(
"Too large", "Too large",
"The allowed maximum value is %s. " "The allowed maximum value is %s. "
"Please try again." % self.maxvalue, "Please try again." % self.maxvalue,