(self, data, options=None, **kwargs)
Return instance of class based on Javascript data

        Data keys handled here:

            type
                Set the object class

            consts, types, vars, funcs
                Recurse into :py:meth:`create_class` to create child object
                instances

        :param data: dictionary data from godocjson output
Return instance of class based on Javascript data
Return instance of class based on Javascript data
def create_class(self, data, options=None, **kwargs):
        """Return instance of class based on Javascript data

        Data keys handled here:

            type
                Set the object class

            consts, types, vars, funcs
                Recurse into :py:meth:`create_class` to create child object
                instances

        :param data: dictionary data from godocjson output
        """
        obj_map = dict((cls.type, cls) for cls in ALL_CLASSES)
        try:
            cls = obj_map[data["kind"]]
        except (KeyError, TypeError):
            # this warning intentionally has no (sub-)type
            LOGGER.warning("Unknown type: %s" % data)
        else:
            # Recurse for children
            obj = cls(data, jinja_env=self.jinja_env, app=self.app)
            if "children" in data:
                for child_data in data["children"]:
                    for child_obj in self.create_class(child_data, options=options):
                        obj.children.append(child_obj)
            yield obj
def create_class ( self , data , options = None , * * kwargs ) : obj_map = dict ( ( cls . type , cls ) for cls in ALL_CLASSES ) try : cls = obj_map [ data [ "kind" ] ] except ( KeyError , TypeError ) : # this warning intentionally has no (sub-)type LOGGER . warning ( "Unknown type: %s" % data ) else : # Recurse for children obj = cls ( data , jinja_env = self . jinja_env , app = self . app ) if "children" in data : for child_data in data [ "children" ] : for child_obj in self . create_class ( child_data , options = options ) : obj . children . append ( child_obj ) yield obj