AdvancedHTMLParser.xpath._filters
index

Copyright (c) 2019 Timothy Savannah under terms of LGPLv3. All Rights Reserved.
 
See LICENSE (https://gnu.org/licenses/lgpl-3.0.txt) for more information.
 
See: https://github.com/kata198/AdvancedHTMLParser for full information
 
 
==INTERNAL==
 
xpath._filters.py - Internal module for holding xpath filtering items

 
Functions
       
_mk_helper_float_comparison_filter_named(attributeName, attributeValue, compareTagAttributeValueToTestValueLambda)
_mk_helper_float_comparison_filter_named - A helper function to make a function which will
 
    test a given attribute value, as a float, and compare it using a provided compare function/lambda.
 
    Named version -- tests a specific attribute, by name.
 
 
    @param attributeName <str> - The name of the attribute to test
 
    @param attributeValue <float/int/str> - The attribute value to test
 
    @param compareTagAttributeValueToTestValueLambda <function/lambda> - The comparison function to use, should return bool (True = match, False = no match)
 
 
    @return <function> - A special comparitive function to use to compare a provided tag against the given attribute name's value and comparison function
_mk_helper_float_comparison_filter_wildcard(attributeValue, compareTagAttributeValueToTestValueLambda)
_mk_helper_float_comparison_filter_wildcard - A helper function to make a function which will
 
    test a given attribute value, as a float, and compare it using a provided compare function/lambda.
 
    Wildcard version, all attributes.
 
 
    @param attributeValue <float/int/str> - The attribute value to test
 
    @param compareTagAttributeValueToTestValueLambda <function/lambda> - The comparison function to use, should return bool (True = match, False = no match)
 
 
    @return <function> - A special comparitive function to use to compare a provided tag against the given attribute value and comparison function
_mk_xpath_op_filter_by_ancestor_or_self_tagname_multi_level_function(tagName)
_mk_xpath_op_filter_by_ancestor_or_self_tagname_multi_level_function - Search all ancestors upward of the current level, and self, for tag name matches
 
    This function will create and return the function to be associated with the XPathOperation
 
 
    @param tagName <str> - The tag name on which to filter, or "*" for wildcard
 
 
    @return list<AdvancedTag> - A list of all tags which matched this filter operation.
_mk_xpath_op_filter_by_ancestor_tagname_multi_level_function(tagName)
_mk_xpath_op_filter_by_ancestor_tagname_multi_level_function - Search all ancestors upward of the current level for tag name matches
 
    This function will create and return the function to be associated with the XPathOperation
 
 
    @param tagName <str> - The tag name on which to filter, or "*" for wildcard
 
 
    @return list<AdvancedTag> - A list of all tags which matched this filter operation.
_mk_xpath_op_filter_by_parent_tagname_one_level_function(tagName)
_mk_xpath_op_filter_by_parent_tagname_one_level_function - Filter one level up of current level for a parent with a given tag name.
 
    This function will create and return a function to be associated with the XPathOperation
 
 
    @param tagName <str> - The tag name for which to filter, or "*" for wildcard.
 
 
    @return list<AdvancedTag> - A list of tags which match this operation.
_mk_xpath_op_filter_by_tagname_multi_level_function(tagName)
_mk_xpath_op_filter_by_tagname_multi_level_function - Filter for a given tag name on any number of levels down
 
    This function will create the function to be associated with the XPathOperation.
 
 
        @param tagName <str> - The tag name on which to filter, or "*" for wildcard
 
 
        @return list< Tags.AdvancedTag > - A list of tags which match this filter operation
_mk_xpath_op_filter_by_tagname_multi_level_function_or_self(tagName)
_mk_xpath_op_filter_by_tagname_multi_level_function_or_self - Filter for a given tag name on any number of levels down and self
 
    This function will create the function to be associated with the XPathOperation.
 
 
        @param tagName <str> - The tag name on which to filter, or "*" for wildcard
 
 
        @return list< Tags.AdvancedTag > - A list of tags which match this filter operation
_mk_xpath_op_filter_by_tagname_one_level_function(tagName)
_mk_xpath_op_filter_by_tagname_one_level_function - Filters one level of descent, by tag name or wildcard.
 
    This function will create and return the function to be used with the associated XPathOperation.
 
 
    ==INTERNAL==
 
 
        @param tagName <str> - The tag name upon which to filter, or "*" for wildcard
 
 
        @return list< AdvancedHTMLParser.Tags.AdvancedTag > - A list of tags which match the provided tagname after descent
_mk_xpath_op_filter_by_tagname_one_level_function_or_self(tagName)
_mk_xpath_op_filter_by_tagname_one_level_function_or_self - Filters one level of descent, by tag name or wildcard, or self.
 
    This function will create and return the function to be used with the associated XPathOperation.
 
 
        @param tagName <str> - The tag name upon which to filter, or "*" for wildcard
 
 
        @return list< AdvancedHTMLParser.Tags.AdvancedTag > - A list of tags which match the provided tagname after descent
_mk_xpath_op_filter_tag_is_nth_child_index(tagName, nthIdxOrd1)
_mk_xpath_op_filter_tag_is_nth_child_index - Filter for the Nth (origin-1) instance of a given tag name, as a child
 
    This function will create the function to be associated with the XPathOperation.
 
 
        @param tagName <str> - The tag name on which to filter, or "*" for wildcard
 
        @param nthIdxOrd1 <int> - An origin-1 number (1 = first, 2 = second) for which child to return, if present.
 
 
        @return list< Tags.AdvancedTag > - A list of tags which match this filter operation.

 
Data
        __all__ = ('_mk_xpath_op_filter_by_tagname_one_level_function', '_mk_xpath_op_filter_by_tagname_one_level_function_or_self', '_mk_xpath_op_filter_by_tagname_multi_level_function', '_mk_xpath_op_filter_by_tagname_multi_level_function_or_self', '_mk_xpath_op_filter_by_parent_tagname_one_level_function', '_mk_xpath_op_filter_by_ancestor_tagname_multi_level_function', '_mk_xpath_op_filter_by_ancestor_or_self_tagname_multi_level_function', '_mk_xpath_op_filter_tag_is_nth_child_index', '_mk_helper_float_comparison_filter_named', '_mk_helper_float_comparison_filter_wildcard')