-
Notifications
You must be signed in to change notification settings - Fork 0
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
Further tweaks and small updates. #6
Conversation
The corresponding addresses are stored in the 'userdata'. It's less direct, but allows the user to see a much friendlier option. It means that if there are only two correct addresses, the possibility of a user inserting incorrect values is removed (and the need for validation is similarly removed). Related to this: reading the config file is now pulled out into a separate function that returns default values on any file read errors.
…g information. QTextEdit.toPlainText returns the contents as plain text, rather than switching it to plain text most: QPlainTextEdit must be used for that instead.
Not hugely important, but such consi8stency ensures a better UX.
"using" -> "uses" for tense consistency. remove "either" since there are more than two interfaces.
…nly text edit. This allows the dialog to be smaller. With triple-quoted strings, even the indenting whitespace is included as part of the string, so they need to sit against the left-hand side of the file. It's a bit ugly, but c'est la vie :)
It's good practice to reduce the scope of variables as much as possible, and it turns out ptflasher.filedialog can be turned into a local variable inside ptflasher.filesearch.
This makes the order of definitions consistent with their appearence in the dialog itself, and consistency is (almost) always helpful :)
It's idiomatic to just say "if variable:" rather than "if variable != ''".
At first glance, nothing is jumping out and the code is certanly a lot cleaner than it was. Not to cast blame (as my Pythonese isn't that great either) but I did wonder what Electr0 was thinking with some of that code. xD I'll try it on Windows tomorrow, but it is looking better on Linux, and working just fine still. Not that it matters, but I think the config dialog can be a little shorter now? |
And don't be concerned about offending... all suggestions and constructive criticisms are welcome! |
Notable changes:
Please take these as they are intended: as (hopefully helpful!) suggestions for improvements, rather than criticism of your work. I'm happy to discuss any of the changes.