add missing docstrings
This commit is contained in:
parent
2a7d59b64d
commit
3a525bcad8
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
"""Find and parse annotations to AnnotationItem objects."""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import pprint
|
import pprint
|
||||||
|
@ -20,6 +21,7 @@ class AnnotationItem:
|
||||||
self.data = defaultdict(dict)
|
self.data = defaultdict(dict)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
"""Beautify object string output."""
|
||||||
for key in self.data.keys():
|
for key in self.data.keys():
|
||||||
for sub in self.data.get(key):
|
for sub in self.data.get(key):
|
||||||
return "AnnotationItem({}: {})".format(key, sub)
|
return "AnnotationItem({}: {})".format(key, sub)
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
"""Entrypoimt and CLI handler."""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import ansibledoctor.Exception
|
||||||
from ansibledoctor import __version__
|
from ansibledoctor import __version__
|
||||||
from ansibledoctor.Config import SingleConfig
|
from ansibledoctor.Config import SingleConfig
|
||||||
from ansibledoctor.DocumentationGenerator import Generator
|
from ansibledoctor.DocumentationGenerator import Generator
|
||||||
from ansibledoctor.DocumentationParser import Parser
|
from ansibledoctor.DocumentationParser import Parser
|
||||||
from ansibledoctor.Utils import SingleLog
|
from ansibledoctor.Utils import SingleLog
|
||||||
import ansibledoctor.Exception
|
|
||||||
|
|
||||||
|
|
||||||
class AnsibleDoctor:
|
class AnsibleDoctor:
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
"""Global settings object definition."""
|
#!/usr/bin/env python3
|
||||||
|
"""Global settings definition."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import anyconfig
|
import anyconfig
|
||||||
import yaml
|
|
||||||
import jsonschema.exceptions
|
import jsonschema.exceptions
|
||||||
|
import yaml
|
||||||
from appdirs import AppDirs
|
from appdirs import AppDirs
|
||||||
from jsonschema._utils import format_as_index
|
from jsonschema._utils import format_as_index
|
||||||
from pkg_resources import resource_filename
|
from pkg_resources import resource_filename
|
||||||
|
|
||||||
from ansibledoctor.Utils import Singleton
|
|
||||||
import ansibledoctor.Exception
|
import ansibledoctor.Exception
|
||||||
|
from ansibledoctor.Utils import Singleton
|
||||||
|
|
||||||
config_dir = AppDirs("ansible-doctor").user_config_dir
|
config_dir = AppDirs("ansible-doctor").user_config_dir
|
||||||
default_config_file = os.path.join(config_dir, "config.yml")
|
default_config_file = os.path.join(config_dir, "config.yml")
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/env python3
|
||||||
|
"""Global constants."""
|
||||||
|
|
||||||
DOCTOR_CONF_FILE = "doctor.conf.yaml"
|
DOCTOR_CONF_FILE = "doctor.conf.yaml"
|
||||||
YAML_EXTENSIONS = ["yaml", "yml"]
|
YAML_EXTENSIONS = ["yaml", "yml"]
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
"""Prepare output and write compiled jinja2 templates."""
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
import glob
|
import glob
|
||||||
|
@ -7,16 +8,16 @@ import ntpath
|
||||||
import os
|
import os
|
||||||
import pprint
|
import pprint
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
import jinja2.exceptions
|
import jinja2.exceptions
|
||||||
import ruamel.yaml
|
import ruamel.yaml
|
||||||
from jinja2 import Environment
|
from jinja2 import Environment
|
||||||
from jinja2 import FileSystemLoader
|
from jinja2 import FileSystemLoader
|
||||||
from six import binary_type
|
from six import binary_type
|
||||||
from six import text_type
|
from six import text_type
|
||||||
import ansibledoctor.Exception
|
|
||||||
|
|
||||||
|
import ansibledoctor.Exception
|
||||||
from ansibledoctor.Config import SingleConfig
|
from ansibledoctor.Config import SingleConfig
|
||||||
from ansibledoctor.Utils import FileUtils
|
from ansibledoctor.Utils import FileUtils
|
||||||
from ansibledoctor.Utils import SingleLog
|
from ansibledoctor.Utils import SingleLog
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
"""Parse static files."""
|
||||||
|
|
||||||
import fnmatch
|
import fnmatch
|
||||||
import json
|
import json
|
||||||
|
@ -67,13 +68,3 @@ class Parser:
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
return self._data
|
return self._data
|
||||||
|
|
||||||
def cli_print_section(self):
|
|
||||||
return self.config.use_print_template
|
|
||||||
|
|
||||||
def cli_left_space(self, item1="", left=25):
|
|
||||||
item1 = item1.ljust(left)
|
|
||||||
return item1
|
|
||||||
|
|
||||||
def test(self):
|
|
||||||
return "test()"
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""Custom exception definition."""
|
"""Custom exceptions."""
|
||||||
|
|
||||||
|
|
||||||
class DoctorError(Exception):
|
class DoctorError(Exception):
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
"""File registry to encapsulate file system related operations."""
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
import pathspec
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import pathspec
|
||||||
|
|
||||||
from ansibledoctor.Config import SingleConfig
|
from ansibledoctor.Config import SingleConfig
|
||||||
from ansibledoctor.Contstants import YAML_EXTENSIONS
|
from ansibledoctor.Contstants import YAML_EXTENSIONS
|
||||||
from ansibledoctor.Utils import SingleLog
|
from ansibledoctor.Utils import SingleLog
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/env python3
|
||||||
|
"""Global utility methods and classes."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import pprint
|
import pprint
|
||||||
|
@ -8,6 +10,7 @@ from distutils.util import strtobool
|
||||||
import colorama
|
import colorama
|
||||||
import yaml
|
import yaml
|
||||||
from pythonjsonlogger import jsonlogger
|
from pythonjsonlogger import jsonlogger
|
||||||
|
|
||||||
import ansibledoctor.Exception
|
import ansibledoctor.Exception
|
||||||
|
|
||||||
CONSOLE_FORMAT = "{}[%(levelname)s]{} %(message)s"
|
CONSOLE_FORMAT = "{}[%(levelname)s]{} %(message)s"
|
||||||
|
|
Loading…
Reference in New Issue