Exemplo n.º 1
0
def _extractScriptNodes(root, encoding=None):

    result = []

    for s_node in root.getElementsByTagName('script'):

        try:
            function = _getNodeAttribute(s_node, 'function')
        except ValueError:
            function = ''

        try:
            module = _getNodeAttribute(s_node, 'module')
        except ValueError:
            module = ''

        info = {
            'script_id': _getNodeAttribute(s_node, 'script_id'),
            'meta_type': _getNodeAttribute(s_node, 'type', encoding),
            'function': function,
            'module': module
        }

        filename = _queryNodeAttribute(s_node, 'filename', None, encoding)

        if filename is not None:
            info['filename'] = filename

        result.append(info)

    return result
Exemplo n.º 2
0
def _extractScriptNodes( root, encoding=None ):

    result = []

    for s_node in root.getElementsByTagName( 'script' ):

        try:
            function = _getNodeAttribute( s_node, 'function' )
        except ValueError:
            function = ''

        try:
            module = _getNodeAttribute( s_node, 'module' )
        except ValueError:
            module = ''

        info = { 'script_id' : _getNodeAttribute( s_node, 'script_id' )
               , 'meta_type' : _getNodeAttribute( s_node, 'type' , encoding )
               , 'function'  : function
               , 'module'    : module
               }

        filename = _queryNodeAttribute( s_node, 'filename' , None, encoding )

        if filename is not None:
            info[ 'filename' ] = filename

        result.append( info )

    return result
Exemplo n.º 3
0
def _extractScriptNodes(root, encoding=None):

    result = []

    for s_node in root.getElementsByTagName('script'):

        info = {
            'script_id': _getNodeAttribute(s_node, 'script_id'),
            'meta_type': _getNodeAttribute(s_node, 'type', encoding)
        }

        filename = _queryNodeAttribute(s_node, 'filename', None, encoding)

        if filename is not None:
            info['filename'] = filename

        result.append(info)

    return result
Exemplo n.º 4
0
def _extractScriptNodes( root, encoding=None ):

    result = []

    for s_node in root.getElementsByTagName( 'script' ):


        info = { 'script_id' : _getNodeAttribute( s_node, 'script_id' )
               , 'meta_type' : _getNodeAttribute( s_node, 'type' , encoding )
               }

        filename = _queryNodeAttribute( s_node, 'filename' , None, encoding )

        if filename is not None:
            info[ 'filename' ] = filename

        result.append( info )

    return result
Exemplo n.º 5
0
 def _qs(key, default=None):
     return _queryNodeAttribute(ti_node, key, default, encoding)
Exemplo n.º 6
0
 def _qs(key, default=None):
     return _queryNodeAttribute(ti_node, key, default, encoding)