Skip to content
This repository

Exclude mod_init from sys.doc and sphinx #1282

Closed
SEJeff opened this Issue May 15, 2012 · 7 comments

3 participants

Jeff Schroeder Thomas S Hatch Dan Colish
Jeff Schroeder
Collaborator
SEJeff commented May 15, 2012

But it is. Perhaps mod_init should be changed to _mod_init and state.py taught to use _mod_init?

Thomas S Hatch
Owner

But it is called from within the state compiler, so to have access to it, it must be public. Also, if you set up a state trying to use it, aka:

vim:
  pkg.mod_init

it will fail

Jeff Schroeder
Collaborator
SEJeff commented May 15, 2012

Perhaps I'm missing something here? Private functions / methods in python don't truly exist. Why can't you just call

if hasattr(module, "_mod_init"): or pkg._mod_init

I realize that will fail, but one of our users was asking in IRC how to use that, clearly that is wrong and they shouldn't see that :)

Thomas S Hatch
Owner

We can probably just set them all to be omitted from the documentation, or, what would be better is if we had a better doc on what the mod_ functions are. The problem with calling the mod functions outside the loader interface is that they are not properly initialized, and they are not available at all in the states dict in the compiler if they are "private"

Jeff Schroeder
Collaborator
SEJeff commented May 15, 2012

Ok, so perhaps we can add exclusions in the docs and sys.doc module. That seems like a reasonable way to go about things. Thoughts?

Thomas S Hatch
Owner

Yes, I like that, I will change the title of the ticket

Dan Colish dcolish referenced this issue from a commit in dcolish/salt May 29, 2012
Dan Colish Skip mod_init when running autodoc, #1282 a3507ab
Dan Colish
dcolish commented May 30, 2012

I'm pretty sure this can be closed.

Thomas S Hatch
Owner

Yes it can! Thanks @dcolish!

Thomas S Hatch thatch45 closed this May 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.