-
Notifications
You must be signed in to change notification settings - Fork 39
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
Consider version and daemon flag on base argparser. Closes #424 #437
Conversation
…pycharm linter to indicate it.
Codecov Report
@@ Coverage Diff @@
## master #437 +/- ##
==========================================
- Coverage 23.31% 23.29% -0.03%
==========================================
Files 6 6
Lines 1111 1112 +1
Branches 169 169
==========================================
Hits 259 259
- Misses 835 836 +1
Partials 17 17
Continue to review full report at Codecov.
|
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 whole technique looks hacky. I was not aware that Python's standard arg parser library does not support optional sub-commands. We might look for some third-party libraries for the task in future.
ipwb/__main__.py
Outdated
cmdError_invalidCommand = argCount > 1 and argsIn[1] not in cmdList | ||
cmdError_invalidCommand = argCount > 1 \ | ||
and argsIn[1] not in cmdList \ | ||
and argsIn[1] not in baseParserFlagList |
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.
These two lines can perhaps be simplified as:
and argsIn[1] not in cmdList + baseParserFlagList
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 may but I recall running into some issues. Your suggestion has been applied, though a line break was still needed for pycodestyle compliance.
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 was a non-blocking stylistic change. Please do make sure that it works as expected after making this change.
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.
@ibnesayeed I did so before applying the changes. Joining lists/arrays via +
makes we wary but I suppose it's a standard Python construct.
The redundancy and hard-coding is not ideal, but this makes the version (and daemon) flags accessible again.