AdvancedHTMLParser.xpath._cache
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._cache.py - Internal module for caching recent XPath expression parsings

 
Modules
       
threading

 
Classes
       
__builtin__.object
XPathExpressionCacheType

 
class XPathExpressionCacheType(__builtin__.object)
    XPathExpressionCacheType - The type of the XPath Expression Cache.
 
    This is meant to be used as a singleton, the instance being "XPathExpressionCache"
 
  Methods defined here:
__init__(self)
__init__ - Create this object
applyCachedExpressionIfAvailable(self, expressionStr, xpathExpressionObj)
applyCachedExpressionIfAvailable - Check if a cached compiled expression object is available, based on the xpath expression string,
 
    and if it is, update the expression object's members with the cached version.
 
 
        @param expressionStr <str> - The XPath expression str
 
        @param xpathExpressionObj <xpath.expression.XPathExpression> - The expression object
 
 
        @return <bool> - True if did apply from cache, False if no match (expression needs to be compiled)
getCachedExpression(self, expressionStr)
getCachedExpression - Try to get a cached XPathExpression object for a given key
 
 
    @param expressionStr <str> - The XPath expression str
 
 
    @return <XPathExpression/None> - The XPathExpression object, if one was cached, otherwise None
setCachedExpression(self, expressionStr, xpathExpressionObj)
setCachedExpression - Sets the expression object to be cached under a given string
 
 
    @param expressionStr <str> - The XPath expression str
 
    @param xpathExpressionObj <XPathExpression> - The XPathExpression object

Static methods defined here:
getKeyForExpressionStr(expressionStr)
getKeyForExpressionStr - Get a unique hash "key" for a given expression str,
 
    as will be used to cache the compiled expression.
 
 
        @param expressionStr <str/unicode/bytes> - The XPath expression str
 
 
        @return <str> - The key

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        XPathExpressionCache = <AdvancedHTMLParser.xpath._cache.XPathExpressionCacheType object>
__all__ = ('XPathExpressionCache', 'XPathExpressionCacheType')