(self)
| 304 | return self.entry |
| 305 | |
| 306 | def validate(self): |
| 307 | try: |
| 308 | result = self.getresult() |
| 309 | except ValueError: |
| 310 | messagebox.showwarning( |
| 311 | "Illegal value", |
| 312 | self.errormessage + "\nPlease try again", |
| 313 | parent = self |
| 314 | ) |
| 315 | return 0 |
| 316 | |
| 317 | if self.minvalue is not None and result < self.minvalue: |
| 318 | messagebox.showwarning( |
| 319 | "Too small", |
| 320 | "The allowed minimum value is %s. " |
| 321 | "Please try again." % self.minvalue, |
| 322 | parent = self |
| 323 | ) |
| 324 | return 0 |
| 325 | |
| 326 | if self.maxvalue is not None and result > self.maxvalue: |
| 327 | messagebox.showwarning( |
| 328 | "Too large", |
| 329 | "The allowed maximum value is %s. " |
| 330 | "Please try again." % self.maxvalue, |
| 331 | parent = self |
| 332 | ) |
| 333 | return 0 |
| 334 | |
| 335 | self.result = result |
| 336 | |
| 337 | return 1 |
| 338 | |
| 339 | |
| 340 | class _QueryInteger(_QueryDialog): |
nothing calls this directly
no test coverage detected