Rename base objects to be more descriptive.

pull/9/head
Eric Holscher 9 years ago
parent a3244a2531
commit 057100b1ee

@ -9,7 +9,7 @@ from sphinx.util.osutil import ensuredir
from ..settings import TEMPLATE_DIR from ..settings import TEMPLATE_DIR
class AutoAPIBase(object): class PythonMapperBase(object):
language = 'base' language = 'base'
type = 'base' type = 'base'
@ -48,9 +48,9 @@ class AutoAPIBase(object):
def __lt__(self, other): def __lt__(self, other):
'''Object sorting comparison''' '''Object sorting comparison'''
if isinstance(other, AutoAPIBase): if isinstance(other, PythonMapperBase):
return self.id < other.id return self.id < other.id
return super(AutoAPIBase, self).__lt__(other) return super(PythonMapperBase, self).__lt__(other)
def __str__(self): def __str__(self):
return '<{cls} {id}>'.format(cls=self.__class__.__name__, return '<{cls} {id}>'.format(cls=self.__class__.__name__,
@ -76,9 +76,9 @@ class AutoAPIBase(object):
return '.'.join(pieces) 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 :param app: Sphinx application instance
''' '''

@ -1,15 +1,12 @@
import os
from collections import defaultdict from collections import defaultdict
import yaml import yaml
from sphinx.util.osutil import ensuredir from .base import PythonMapperBase, SphinxMapperBase
from .base import AutoAPIBase, AutoAPIDomain
MADE = set() MADE = set()
class DotNetDomain(AutoAPIDomain): class DotNetDomain(SphinxMapperBase):
'''Auto API domain handler for .NET '''Auto API domain handler for .NET
@ -165,7 +162,7 @@ class DotNetDomain(AutoAPIDomain):
# top_level_file.write(content.render(pages=self.namespaces.values())) # top_level_file.write(content.render(pages=self.namespaces.values()))
class DotNetBase(AutoAPIBase): class DotNetBase(PythonMapperBase):
'''Base .NET object representation''' '''Base .NET object representation'''

@ -1,10 +1,10 @@
import json import json
import subprocess import subprocess
from .base import AutoAPIBase, AutoAPIDomain from .base import PythonMapperBase, SphinxMapperBase
class GoDomain(AutoAPIDomain): class GoDomain(SphinxMapperBase):
'''Auto API domain handler for Go '''Auto API domain handler for Go
@ -89,7 +89,7 @@ class GoDomain(AutoAPIDomain):
yield obj yield obj
class GoBase(AutoAPIBase): class GoBase(PythonMapperBase):
language = 'go' language = 'go'
inverted_names = False inverted_names = False

@ -1,12 +1,11 @@
import os
import json import json
import subprocess import subprocess
from .base import AutoAPIBase, AutoAPIDomain from .base import PythonMapperBase, SphinxMapperBase
class JavaScriptDomain(AutoAPIDomain): class JavaScriptDomain(SphinxMapperBase):
'''Auto API domain handler for Javascript '''Auto API domain handler for Javascript
@ -73,7 +72,7 @@ class JavaScriptDomain(AutoAPIDomain):
yield obj yield obj
class JavaScriptBase(AutoAPIBase): class JavaScriptBase(PythonMapperBase):
language = 'javascript' language = 'javascript'

@ -2,10 +2,10 @@ from collections import defaultdict
from epyparse import parsed 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 '''Auto API domain handler for Python
@ -60,7 +60,7 @@ class PythonDomain(AutoAPIDomain):
yield obj yield obj
class PythonBase(AutoAPIBase): class PythonBase(PythonMapperBase):
language = 'python' language = 'python'

Loading…
Cancel
Save