Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Exclude mod_init from sys.doc and sphinx #1282

Closed
SEJeff opened this Issue · 7 comments

3 participants

@SEJeff
Owner

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

@thatch45
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

@SEJeff
Owner

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 :)

@thatch45
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"

@SEJeff
Owner

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?

@thatch45
Owner

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

@dcolish dcolish referenced this issue from a commit in dcolish/salt
@dcolish dcolish Skip mod_init when running autodoc, #1282 a3507ab
@dcolish

I'm pretty sure this can be closed.

@thatch45
Owner

Yes it can! Thanks @dcolish!

@thatch45 thatch45 closed this
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.