From 057100b1eef976c1562dae9b4892e7b4ec9569f2 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 10 Jun 2015 11:53:09 -0700 Subject: [PATCH] Rename base objects to be more descriptive. --- autoapi/domains/base.py | 10 +++++----- autoapi/domains/dotnet.py | 9 +++------ autoapi/domains/go.py | 6 +++--- autoapi/domains/javascript.py | 7 +++---- autoapi/domains/python.py | 6 +++--- 5 files changed, 17 insertions(+), 21 deletions(-) diff --git a/autoapi/domains/base.py b/autoapi/domains/base.py index 729fc9b..62b4a09 100644 --- a/autoapi/domains/base.py +++ b/autoapi/domains/base.py @@ -9,7 +9,7 @@ from sphinx.util.osutil import ensuredir from ..settings import TEMPLATE_DIR -class AutoAPIBase(object): +class PythonMapperBase(object): language = 'base' type = 'base' @@ -48,9 +48,9 @@ class AutoAPIBase(object): def __lt__(self, other): '''Object sorting comparison''' - if isinstance(other, AutoAPIBase): + if isinstance(other, PythonMapperBase): return self.id < other.id - return super(AutoAPIBase, self).__lt__(other) + return super(PythonMapperBase, self).__lt__(other) def __str__(self): return '<{cls} {id}>'.format(cls=self.__class__.__name__, @@ -76,9 +76,9 @@ class AutoAPIBase(object): return '.'.join(pieces) -class AutoAPIDomain(object): +class SphinxMapperBase(object): - '''Base class for domain handling + '''Base class for mapping `PythonMapperBase` objects to Sphinx. :param app: Sphinx application instance ''' diff --git a/autoapi/domains/dotnet.py b/autoapi/domains/dotnet.py index 20492f9..4738725 100644 --- a/autoapi/domains/dotnet.py +++ b/autoapi/domains/dotnet.py @@ -1,15 +1,12 @@ -import os from collections import defaultdict import yaml -from sphinx.util.osutil import ensuredir - -from .base import AutoAPIBase, AutoAPIDomain +from .base import PythonMapperBase, SphinxMapperBase MADE = set() -class DotNetDomain(AutoAPIDomain): +class DotNetDomain(SphinxMapperBase): '''Auto API domain handler for .NET @@ -165,7 +162,7 @@ class DotNetDomain(AutoAPIDomain): # top_level_file.write(content.render(pages=self.namespaces.values())) -class DotNetBase(AutoAPIBase): +class DotNetBase(PythonMapperBase): '''Base .NET object representation''' diff --git a/autoapi/domains/go.py b/autoapi/domains/go.py index a5263ad..77c8e4e 100644 --- a/autoapi/domains/go.py +++ b/autoapi/domains/go.py @@ -1,10 +1,10 @@ import json import subprocess -from .base import AutoAPIBase, AutoAPIDomain +from .base import PythonMapperBase, SphinxMapperBase -class GoDomain(AutoAPIDomain): +class GoDomain(SphinxMapperBase): '''Auto API domain handler for Go @@ -89,7 +89,7 @@ class GoDomain(AutoAPIDomain): yield obj -class GoBase(AutoAPIBase): +class GoBase(PythonMapperBase): language = 'go' inverted_names = False diff --git a/autoapi/domains/javascript.py b/autoapi/domains/javascript.py index 032dba5..ef740df 100644 --- a/autoapi/domains/javascript.py +++ b/autoapi/domains/javascript.py @@ -1,12 +1,11 @@ -import os import json import subprocess -from .base import AutoAPIBase, AutoAPIDomain +from .base import PythonMapperBase, SphinxMapperBase -class JavaScriptDomain(AutoAPIDomain): +class JavaScriptDomain(SphinxMapperBase): '''Auto API domain handler for Javascript @@ -73,7 +72,7 @@ class JavaScriptDomain(AutoAPIDomain): yield obj -class JavaScriptBase(AutoAPIBase): +class JavaScriptBase(PythonMapperBase): language = 'javascript' diff --git a/autoapi/domains/python.py b/autoapi/domains/python.py index a2bc704..60cf20b 100644 --- a/autoapi/domains/python.py +++ b/autoapi/domains/python.py @@ -2,10 +2,10 @@ from collections import defaultdict from epyparse import parsed -from .base import AutoAPIBase, AutoAPIDomain +from .base import PythonMapperBase, SphinxMapperBase -class PythonDomain(AutoAPIDomain): +class PythonDomain(SphinxMapperBase): '''Auto API domain handler for Python @@ -60,7 +60,7 @@ class PythonDomain(AutoAPIDomain): yield obj -class PythonBase(AutoAPIBase): +class PythonBase(PythonMapperBase): language = 'python'