Small domain cleanup

pull/9/head
Eric Holscher 9 years ago
parent a838e5333d
commit 0c1bcece23

@ -1,9 +1,6 @@
import json import json
import os
import subprocess import subprocess
from sphinx.util.osutil import ensuredir
from .base import AutoAPIBase, AutoAPIDomain from .base import AutoAPIBase, AutoAPIDomain

@ -32,6 +32,7 @@ class JavaScriptDomain(AutoAPIDomain):
self.app.warn('Error reading file: {0}'.format(path)) self.app.warn('Error reading file: {0}'.format(path))
return None return None
# Subclassed to iterate over items
def map(self): def map(self):
'''Trigger find of serialized sources and build objects''' '''Trigger find of serialized sources and build objects'''
for path, data in self.paths.items(): for path, data in self.paths.items():
@ -64,7 +65,7 @@ class JavaScriptDomain(AutoAPIDomain):
self.app.warn('Unknown Type: %s' % data) self.app.warn('Unknown Type: %s' % data)
else: else:
# Recurse for children # Recurse for children
obj = cls(data) obj = cls(data, jinja_env=self.jinja_env)
if 'children' in data: if 'children' in data:
for child_data in data['children']: for child_data in data['children']:
for child_obj in self.create_class(child_data): for child_obj in self.create_class(child_data):
@ -76,7 +77,7 @@ class JavaScriptBase(AutoAPIBase):
language = 'javascript' language = 'javascript'
def __init__(self, obj): def __init__(self, obj, **kwargs):
''' '''
Map JSON data into Python object. Map JSON data into Python object.
@ -84,7 +85,7 @@ class JavaScriptBase(AutoAPIBase):
so we try and keep standard naming to keep templates more re-usable. so we try and keep standard naming to keep templates more re-usable.
''' '''
super(JavaScriptBase, self).__init__(obj) super(JavaScriptBase, self).__init__(obj, **kwargs)
self.name = obj.get('name') self.name = obj.get('name')
self.id = self.name self.id = self.name

Loading…
Cancel
Save