-
Notifications
You must be signed in to change notification settings - Fork 127
Fixed issue where completion display function was overwritten when a … #376
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
Conversation
…submenu quits. Fixed issue where submenus did not pass up all completion parameters to complete().
Codecov Report
@@ Coverage Diff @@
## master #376 +/- ##
==========================================
+ Coverage 90.93% 91.11% +0.18%
==========================================
Files 5 5
Lines 2251 2252 +1
==========================================
+ Hits 2047 2052 +5
+ Misses 204 200 -4
Continue to review full report at Codecov.
|
|
@kmvanbrunt I verified that the "Unbound local variable" warnings are all innocuous false positives. They occur because PyCharm isn't smart enough to realize that they exist within identical conditionals in different parts of the code. |
tleonhardt
left a comment
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.
Looks good to me
| submenu.allow_appended_space = _self.allow_appended_space | ||
| submenu.allow_closing_quote = _self.allow_closing_quote | ||
| submenu.display_matches = _self.display_matches | ||
|
|
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.
Instead of copying these attributes back and forth, why not put these attributes in its own object and pass a reference down the submenus? If submenus modify these values it will be on the same instance the outer layer is using.
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.
submenu and _self are cmd2 objects and the members being copied are edited by completer functions using self.value type statements. I don't know of a way to do what you are suggesting.
Fixed issue where completion display function was overwritten when a submenu quits.
Fixed issue where submenus did not pass up all completion parameters to complete().
@kotfu
The second issue fixed might apply to the problem you are having. Look at the code I added in
complete_submenu()@tleonhardt
Can you check the "Unbound local variable" warnings and see if you have a good way of getting rid of them? I didn't want to add four # noinspection PyUnboundLocalVariable statements.
If this fix is OK, then I can add it to the Python 2 branch.