moved hardcoded settings from doccli to constants

pull/14827/head
Brian Coca 9 years ago
parent 27b02e8f6c
commit 75b9c7db14

@ -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])

@ -302,3 +302,6 @@ VAULT_VERSION_MIN = 1.0
VAULT_VERSION_MAX = 1.0 VAULT_VERSION_MAX = 1.0
TREE_DIR = None TREE_DIR = None
LOCALHOST = frozenset(['127.0.0.1', 'localhost', '::1']) LOCALHOST = frozenset(['127.0.0.1', 'localhost', '::1'])
# module search
BLACKLIST_EXTS = ('.pyc', '.swp', '.bak', '~', '.rpm', '.md', '.txt')
IGNORE_FILES = [ "COPYING", "CONTRIBUTING", "LICENSE", "README", "VERSION", "GUIDELINES", "test-docs.sh"]

Loading…
Cancel
Save