-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge rdbende:numberentry into master to add NumberEntry widget #79
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a serious security threat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
/tests
AUTHORS.md