|
|
@ -26,6 +26,7 @@ import textwrap
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.compat.six import iteritems
|
|
|
|
from ansible.compat.six import iteritems
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from ansible import constants as C
|
|
|
|
from ansible.errors import AnsibleError, AnsibleOptionsError
|
|
|
|
from ansible.errors import AnsibleError, AnsibleOptionsError
|
|
|
|
from ansible.plugins import module_loader
|
|
|
|
from ansible.plugins import module_loader
|
|
|
|
from ansible.cli import CLI
|
|
|
|
from ansible.cli import CLI
|
|
|
@ -41,9 +42,6 @@ except ImportError:
|
|
|
|
class DocCLI(CLI):
|
|
|
|
class DocCLI(CLI):
|
|
|
|
""" Vault command line class """
|
|
|
|
""" Vault command line class """
|
|
|
|
|
|
|
|
|
|
|
|
BLACKLIST_EXTS = ('.pyc', '.swp', '.bak', '~', '.rpm', '.md', '.txt')
|
|
|
|
|
|
|
|
IGNORE_FILES = [ "COPYING", "CONTRIBUTING", "LICENSE", "README", "VERSION", "GUIDELINES", "test-docs.sh"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, args):
|
|
|
|
def __init__(self, args):
|
|
|
|
|
|
|
|
|
|
|
|
super(DocCLI, self).__init__(args)
|
|
|
|
super(DocCLI, self).__init__(args)
|
|
|
@ -96,7 +94,7 @@ class DocCLI(CLI):
|
|
|
|
display.warning("module %s not found in %s\n" % (module, DocCLI.print_paths(module_loader)))
|
|
|
|
display.warning("module %s not found in %s\n" % (module, DocCLI.print_paths(module_loader)))
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
if any(filename.endswith(x) for x in self.BLACKLIST_EXTS):
|
|
|
|
if any(filename.endswith(x) for x in C.BLACKLIST_EXTS):
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
@ -143,11 +141,11 @@ class DocCLI(CLI):
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
elif os.path.isdir(module):
|
|
|
|
elif os.path.isdir(module):
|
|
|
|
self.find_modules(module)
|
|
|
|
self.find_modules(module)
|
|
|
|
elif any(module.endswith(x) for x in self.BLACKLIST_EXTS):
|
|
|
|
elif any(module.endswith(x) for x in C.BLACKLIST_EXTS):
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
elif module.startswith('__'):
|
|
|
|
elif module.startswith('__'):
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
elif module in self.IGNORE_FILES:
|
|
|
|
elif module in C.IGNORE_FILES:
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
elif module.startswith('_'):
|
|
|
|
elif module.startswith('_'):
|
|
|
|
fullpath = '/'.join([path,module])
|
|
|
|
fullpath = '/'.join([path,module])
|
|
|
|