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

CIA-270: Refactor Commands #81

Merged
merged 5 commits into from
Jan 7, 2016
Merged

CIA-270: Refactor Commands #81

merged 5 commits into from
Jan 7, 2016

Conversation

identifystation
Copy link
Contributor

This looks like a huge change, but it's mostly moving code around and removing duplication. I was unable to use Remy's DocOpt pattern mentioned in #76 due to an unresolved DocOpt bug. However this work makes it very easy to switch to his pattern at a later time.

  • Refactored commands.py to use a separate class for each command.
  • No longer subclassing all commands for static inventory. Removed the redefinition of many methods.
  • Cleaned up DocOpt spacing in cli.py to be consistent.

if create_instances and not idempotent:
self.create()
Create(self.args, self.molecule).execute()
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a blocker, just my 2 cents:
You used this pattern in a lot of places, but I prefer to see that split in 2 lines, one for creating the object, one for calling the function.

@rgreinho
Copy link
Contributor

rgreinho commented Jan 6, 2016

I like it! Way clearer/simpler! 👍

@identifystation
Copy link
Contributor Author

@rgreinho No problem, I updated to break those all out into multiple lines.

@retr0h
Copy link
Contributor

retr0h commented Jan 7, 2016

+1 Yeah, deff a good cleanup.

identifystation pushed a commit that referenced this pull request Jan 7, 2016
CIA-270: Refactor Commands
@identifystation identifystation merged commit 2deac18 into master Jan 7, 2016
@rgreinho rgreinho deleted the CIA-270 branch January 7, 2016 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants