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

CLI generator #410

Merged
merged 1 commit into from
Aug 27, 2012
Merged

CLI generator #410

merged 1 commit into from
Aug 27, 2012

Conversation

tstrachota
Copy link
Member

This utility semi-automatically generates python code for Katello CLI
based on json exports from apipie documentation tool.

It generates:

  • python bindings for the documented api (goes into: /katello/client/api/<RESOURCE_NAME>.py)
  • code for cli command (goes into: /katello/client/core/<RESOURCE_NAME>.py)
  • code frame for actions (goes into: --^ )
  • code for wiring commands and actions into the cli (goes into: /katello/client/main.py)

@@ -0,0 +1,143 @@
#http://code.google.com/p/inflectorpy/
Copy link
Contributor

Choose a reason for hiding this comment

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

I really do not like copy'n'paste code form wild internet without thinking about license and updates.

Can you please create package inflectorpy, give it correct license and require it here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd accept license in this file with the note where it was taken from, its a bit of code rather than a library ;-)

@tstrachota
Copy link
Member Author

I packed the code into python-inflector package. It's available in our nightly repos. The original inflector.py file has been deleted.

@xsuchy
Copy link
Contributor

xsuchy commented Aug 17, 2012

$ spacewalk-pylint generate.py
************* Module generate
C0301:239,0: Line too long (131/120)
W0311:239,0: Bad indentation. Found 11 spaces, expected 12
W0311:240,0: Bad indentation. Found 11 spaces, expected 12
W0621: 54,23:Param.init: Redefining name 'json' from outer scope (line 20)
W0621: 83,23:Method.init: Redefining name 'json' from outer scope (line 20)
R0201:145,4:Method.can_unnest: Method could be a function
W0621:163,23:Resource.__init
: Redefining name 'json' from outer scope (line 20)
W0612:222,10:generate: Unused variable 'args'
W0612:227,21:generate: Unused variable 'e'

# in this software or its documentation.
#

import os
Copy link
Contributor

Choose a reason for hiding this comment

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

import os is not used

@xsuchy
Copy link
Contributor

xsuchy commented Aug 17, 2012

beside those coding errors it looks good.

@lzap
Copy link
Contributor

lzap commented Aug 27, 2012

I recommend to merge it and we can improve those code quality things later on since Tom is out.

@xsuchy
Copy link
Contributor

xsuchy commented Aug 27, 2012

Agreed, they are just warning and recommendation. Nothing too hard.
ACK and I will create notification in my calendar to poke Tomas when he will return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants