From a5a34df7f468f4bad0dc6bcc5fdea7b2593d385d Mon Sep 17 00:00:00 2001 From: Anthony Johnson Date: Tue, 25 Oct 2016 16:26:30 -0700 Subject: [PATCH] Basic cleanup on docstrings, import order --- autoapi/mappers/base.py | 7 +------ autoapi/mappers/python.py | 10 ++++------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/autoapi/mappers/base.py b/autoapi/mappers/base.py index 45faf4b..acc8c24 100644 --- a/autoapi/mappers/base.py +++ b/autoapi/mappers/base.py @@ -124,8 +124,7 @@ class PythonMapperBase(object): return slug.split('.')[-1] def include_dir(self, root): - """Return directory of file - """ + """Return directory of file""" return os.path.join( root, os.path.dirname(self.path.relative), @@ -278,10 +277,6 @@ class SphinxMapperBase(object): def output_rst(self, root, source_suffix): for id, obj in self.objects.items(): - # if not obj or not obj.top_level_object: - # print "Skipping {obj} as it isn't a top level object".format(obj=obj) - # continue - rst = obj.render() if not rst: continue diff --git a/autoapi/mappers/python.py b/autoapi/mappers/python.py index ff41c21..573d027 100644 --- a/autoapi/mappers/python.py +++ b/autoapi/mappers/python.py @@ -1,12 +1,11 @@ import os -from collections import defaultdict import textwrap +from collections import defaultdict +from pydocstyle.parser import Parser from .base import PythonMapperBase, SphinxMapperBase from ..utils import slugify -from pydocstyle.parser import Parser - class PythonSphinxMapper(SphinxMapperBase): @@ -35,11 +34,10 @@ class PythonSphinxMapper(SphinxMapperBase): return None def create_class(self, data, options=None, **kwargs): - ''' - Create a class from the passed in data + """Create a class from the passed in data :param data: dictionary data of pydocstyle output - ''' + """ obj_map = dict((cls.type, cls) for cls in [PythonClass, PythonFunction, PythonModule, PythonMethod, PythonPackage]) try: