Massive unused/unnecessary variable sweep-up, and more #3021
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As the branch name indicates, this started as just a set of fixes for one specific issue: the throwaway half of the tuple returned by
QFileDialog.getOpenFileName()
. But, it ballooned into a lot more. All of the changes are centered around the theme of reducing unused-and-unnecessary variables (both to quiet warnings from static analysis, and to streamline the code).Fix
QFileDialog.getOpenFileName()
callsfile_type
return value, when not used (which is always)Apparently the typical pattern for this is:
_
to the translation wrapper. So, I just went with:Similar cleanup with the use of
os.path
standard library functionsI went through EVERY
.py
file in the repo, and looked at all of the uses of theos.path
library functions, looking to reduce the number of one-sidedos.path.split()
/os.path.splitext()
calls and the unused variables they engendered. Meaning...Also, cut down on indentation by reworking some loops like:
Old...
New...
Clean up
app
vsget_app()
usage inmain_window.py
get_app()
frequently, make sure we've setapp = get_app()
at the top, and replace every remaining instance ofget_app()
withapp
.app
/get_app()
often, eliminateapp
and just useget_app()
directly.