Skip to content
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

General code cleanup for Interactive, resolve pylint, some fixes #5745

Merged
merged 4 commits into from
Mar 8, 2018

Conversation

williexu
Copy link
Contributor

@williexu williexu commented Mar 7, 2018


-moved azclishell code to command_module/interactive folder
-command_table loading more robust to exceptions
Fixes: #5688
-fixed broken --progress param for long running operations
-lots of code cleanup

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

(see Authoring Command Modules)

@williexu williexu added the Interactive az interactive label Mar 7, 2018
@promptws
Copy link

promptws commented Mar 7, 2018

View a preview at https://prompt.ws/r/Azure/azure-cli/5745
This is an experimental preview for @microsoft users.

@williexu williexu changed the title Completers General code cleanup for Interactive, resolve pylint, some fixes Mar 7, 2018
columns = right - left + 1
lines = bottom - top + 1
return lines, columns
windll.kernel32.GetConsoleScreenBufferInfo(h, csbi)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you removed the if condition here?

def __init__(self):
self.command_table = None
self.shell_ctx = None
command_table = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a class variable rather than an instance variable like it was before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were using a global variable to keep an instance of the table as a singleton.
Keeping the table in a class as a variable accomplishes the same and seems to be preferable in python.

Copy link
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to tell what's changed and what's just moved. As you yourself have pointed out, the interactive tests aren't great at preventing regressions, so hopefully you have thoroughly tested interactive manually with your changes. If not, you might defer this to the next release, especially if its mostly refactoring. But if you are happy with it, so am I.

@williexu williexu merged commit dd75a3c into Azure:dev Mar 8, 2018
@williexu williexu deleted the completers branch March 9, 2018 22:49
@haroldrandom haroldrandom added the Interactive az interactive label Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interactive az interactive
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completions do not appear if command table dump encounters an exception
5 participants