mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
moved hardcoded settings from doccli to constants
This commit is contained in:
parent
27b02e8f6c
commit
75b9c7db14
2 changed files with 7 additions and 6 deletions
|
@ -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…
Reference in a new issue