Merge rdbende:numberentry into master to add NumberEntry widget#79
Merge rdbende:numberentry into master to add NumberEntry widget#79rdbende wants to merge 20 commits intoTkinterEP:masterfrom
Conversation
An entry that takes only numbers or calculations and calculates the result of the calculation
Change the default hover-cursor from hand1 to hand2
Change the movement cursor from exchange to fleur
Change the default cursor to use the native link pointer on Mac and Windows
Add __getitem__, __setitem__, config and configure, docstring formatting
Codecov Report
@@ Coverage Diff @@
## master #79 +/- ##
==========================================
- Coverage 89.63% 89.40% -0.23%
==========================================
Files 43 44 +1
Lines 4032 4106 +74
==========================================
+ Hits 3614 3671 +57
- Misses 418 435 +17
Continue to review full report at Codecov.
|
| specified in allowed_chars (default is True) | ||
| :type variables: bool | ||
| """ | ||
| self._allowed = allowed_chars |
There was a problem hiding this comment.
This is a serious security threat.
There was a problem hiding this comment.
It should allow numbers and operator characters only.
| self.insert(0, result) | ||
| except SyntaxError: | ||
| self.delete(0, tk.END) | ||
| self.insert(0, "SyntaxError") |
There was a problem hiding this comment.
This is a bad idea. Why would the user care? Simply just do nothing with the expression. Or maybe set the invalid ttk state on the entry
| self.insert(0, "ZeroDivisionError") | ||
| self.select_range(0, tk.END) | ||
|
|
||
| def _check(self, *args): |
There was a problem hiding this comment.
Ohh, this looks cursed. And why didn't I use an actual validator function?
PR Details:
Description
An entry that takes only numbers, calculations, or variables, and calculates the result of the calculation
Checklist
/examples/testsAUTHORS.md