wavedrom/tspan.py
def extract_element(self, e):
        """Extract AttrDict from jsonml

        This function non-recursively extracts an AttrDict from jsonml.
        This AttrDict has the three elements tagname, attributes and
        element_list according to the jsonml specification.

        :param e: element as jsonml list/tuple
        :return: AttrDict
        """
        if not isinstance(e, (list, tuple)):
            raise ValueError("JsonML must be a list")
        if len(e) == 0:
            raise ValueError("JsonML cannot be an empty list")
        if not isinstance(e[0], string_types):
            raise ValueError("JsonML tagname must be string")
        ret = AttrDict({"tagname": e[0], "attributes": {}, "element-list": []})
        if len(e) > 1:
            if isinstance(e[1], dict):
                ret.attributes = e[1]
                if len(e) > 2:
                    ret.element_list = e[2:]
            else:
                ret.element_list = e[1:]
        return ret
Extract AttrDict from jsonml

        This function non-recursively extracts an AttrDict from jsonml.
        This AttrDict has the three elements tagname, attributes and
        element_list according to the jsonml specification.

        :param e: element as jsonml list/tuple
        :return: AttrDict
        
Extract AttrDict from jsonml
This function non-recursively extracts an AttrDict from jsonml.
This AttrDict has the three elements tagname, attributes and
element_list according to the jsonml specification.
Extract AttrDict from jsonml This function non - recursively extracts an AttrDict from jsonml . This AttrDict has the three elements tagname attributes and element_list according to the jsonml specification .
def extract_element(self, e):
        if not isinstance(e, (list, tuple)):
            raise ValueError("JsonML must be a list")
        if len(e) == 0:
            raise ValueError("JsonML cannot be an empty list")
        if not isinstance(e[0], string_types):
            raise ValueError("JsonML tagname must be string")
        ret = AttrDict({"tagname": e[0], "attributes": {}, "element-list": []})
        if len(e) > 1:
            if isinstance(e[1], dict):
                ret.attributes = e[1]
                if len(e) > 2:
                    ret.element_list = e[2:]
            else:
                ret.element_list = e[1:]
        return ret
def extract_element ( self , e ) : if not isinstance ( e , ( list , tuple ) ) : raise ValueError ( "JsonML must be a list" ) if len ( e ) == 0 : raise ValueError ( "JsonML cannot be an empty list" ) if not isinstance ( e [ 0 ] , string_types ) : raise ValueError ( "JsonML tagname must be string" ) ret = AttrDict ( { "tagname" : e [ 0 ] , "attributes" : { } , "element-list" : [ ] } ) if len ( e ) > 1 : if isinstance ( e [ 1 ] , dict ) : ret . attributes = e [ 1 ] if len ( e ) > 2 : ret . element_list = e [ 2 : ] else : ret . element_list = e [ 1 : ] return ret
Extract AttrDict from jsonml
This function non-recursively extracts an AttrDict from jsonml.
Extract AttrDict from jsonml This function non - recursively extracts an AttrDict from jsonml .
"""Extract AttrDict from jsonml

        This function non-recursively extracts an AttrDict from jsonml.
        This AttrDict has the three elements tagname, attributes and
        element_list according to the jsonml specification.

        :param e: element as jsonml list/tuple
        :return: AttrDict
        """
None
self
e
element as jsonml list/tuple
element as jsonml list / tuple