Module Expr Str Import alias ImportFrom alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias alias Import alias Assign NameStore TupleLoad Str Str Str FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults vararg body Expr Str FunctionDef arguments args NameParam defaults body If Call NameLoad NameLoad TupleLoad NameLoad NameLoad NameLoad body For NameStore NameLoad body For NameStore Call NameLoad NameLoad body Expr Yield NameLoad orelse If Call NameLoad NameLoad NameLoad body For NameStore Call NameLoad Call AttributeLoad NameLoad attr body For NameStore Call NameLoad NameLoad body Expr Yield NameLoad For NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad body Expr Yield NameLoad orelse If Call NameLoad NameLoad NameLoad body Expr Yield Call AttributeLoad Call AttributeLoad NameLoad attr attr Str orelse If Call NameLoad NameLoad NameLoad body Expr Yield Call AttributeLoad Call NameLoad NameLoad attr Str orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Yield Call AttributeLoad NameLoad attr Str orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Yield NameLoad orelse If Call NameLoad NameLoad Str body For NameStore Call NameLoad Call AttributeLoad NameLoad attr body Expr Yield NameLoad orelse If CompareIs NameLoad NameLoad body Expr Yield Call AttributeLoad Str attr Str orelse If Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Yield Call AttributeLoad Call NameLoad Call NameLoad NameLoad attr Str orelse Raise Call NameLoad BinOpMod Str Call NameLoad NameLoad decorator_list Assign NameStore Call NameLoad For NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Raise Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BoolOpOr CompareEq NameLoad NameLoad CompareEq NameLoad NameLoad CompareEq Call NameLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad Call NameLoad NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type NameLoad body Pass Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Slice Num Call NameLoad Num BinOpSub Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Call NameLoad NameLoad For NameStore NameLoad body Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Num FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BoolOpOr CompareEq NameLoad NameLoad CompareEq AttributeLoad NameLoad attr NameLoad CompareEq Call NameLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpMod Str Call NameLoad AttributeLoad NameLoad attr NameLoad TryExcept body Assign NameStore Call NameLoad NameLoad Str handlers ExceptHandler type NameLoad name NameStore body If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Return NameLoad TryFinally body Assign NameStore Call AttributeLoad NameLoad attr finalbody Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore BinOpMod Str Call NameLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr keyword BinOpAdd Str NameLoad keyword AttributeLoad NameLoad attr TryExcept body With Call AttributeLoad NameLoad attr NameLoad Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler body Expr Call AttributeLoad NameLoad attr NameLoad Raise decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot NameLoad body Return NameLoad If Call NameLoad NameLoad NameLoad body Return NameLoad orelse If BoolOpAnd Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad body Return Call NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore NameLoad Return Call NameLoad NameLoad AttributeLoad NameLoad attr decorator_list
N/A N/A Caches are used for multiple things:

    - To speed up asset building. Filter operations every step
      of the way can be cached, so that individual parts of a
      build that haven't changed can be reused.

    - Bundle definitions are cached when a bundle is built so we
      can determine whether they have changed and whether a rebuild
      is required.

This data is not all stored in the same cache necessarily. The
classes in this module provide the "environment.cache" object, but
also serve in other places.
 N/A os os path N/A errno N/A tempfile N/A warnings webassets six webassets.merge BaseHunk webassets.filter Filter freezedicts webassets.utils md5_constructor pickle N/A types N/A __all__ N/A FilesystemCache MemoryCache get_cache make_hashable N/A N/A data N/A N/A N/A Ensures ``data`` can be hashed().

    Mostly needs to support dict. The other special types we use
    as hash keys (Hunks, Filters) already have a proper hash() method.

    See also ``make_md5``.

    Note that we do not actually hash the data for the memory cache.
     N/A N/A freezedicts data N/A make_md5 N/A N/A N/A data N/A N/A Make a md5 hash based on``data``.

    Specifically, this knows about ``Hunk`` objects, and makes sure
    the actual content is hashed.

    This is very conservative, and raises an exception if there are
    data types that it does not explicitly support. This is because
    we had in the past some debugging headaches with the cache not
    working for this very reason.

    MD5 is faster than sha, and we don't care so much about collisions.
    We care enough however not to use hash().
     walk N/A N/A obj N/A N/A N/A N/A isinstance obj N/A tuple list frozenset N/A N/A item obj N/A N/A d N/A walk item N/A N/A N/A d N/A N/A N/A isinstance obj dict N/A N/A k N/A sorted N/A N/A obj keys N/A N/A d N/A walk k N/A N/A N/A d N/A d N/A walk N/A obj N/A k N/A N/A N/A d N/A N/A N/A isinstance obj BaseHunk N/A N/A N/A N/A N/A N/A N/A obj data encode utf-8 N/A N/A N/A isinstance obj int N/A N/A N/A N/A N/A N/A str obj encode utf-8 N/A N/A N/A isinstance obj N/A six text_type N/A N/A N/A N/A N/A obj encode utf-8 N/A N/A N/A isinstance obj N/A six binary_type N/A N/A N/A obj N/A N/A N/A hasattr obj id N/A N/A i N/A walk N/A N/A obj id N/A N/A N/A i N/A N/A N/A obj None N/A N/A N/A N/A N/A None encode utf-8 N/A N/A N/A isinstance obj N/A types FunctionType N/A N/A N/A N/A N/A N/A str N/A hash obj encode utf-8 N/A N/A N/A ValueError N/A Cannot MD5 type %s N/A type obj N/A N/A md5 N/A md5_constructor N/A d N/A walk data N/A N/A N/A N/A md5 update d N/A N/A N/A md5 hexdigest N/A safe_unpickle N/A N/A string N/A N/A N/A Unpickle the string, or return ``None`` if that fails. N/A N/A N/A N/A N/A pickle loads string N/A N/A N/A N/A None N/A BaseCache N/A object N/A N/A Abstract base class.

    The cache key must be something that is supported by the Python hash()
    function. The cache value may be a string, or anything that can be pickled.

    Since the cache is used for multiple purposes, all webassets-internal code
    should always tag its keys with an id, like so:

        key = ("tag", actual_key)

    One cache instance can only be used safely with a single Environment.
     get N/A N/A self key N/A N/A N/A Should return the cache contents, or False.
         N/A N/A NotImplementedError N/A set N/A N/A self key value N/A N/A N/A N/A NotImplementedError N/A N/A MemoryCache N/A BaseCache N/A N/A Caches stuff in the process memory.

    WARNING: Do NOT use this in a production environment, where you
    are likely going to have multiple processes serving the same app!

    Note that the keys are used as-is, not passed through hash() (which is
    a difference: http://stackoverflow.com/a/9022664/15677). However, the
    reason we don't is because the original value is nicer to debug.
     __init__ N/A N/A self capacity N/A N/A N/A N/A self capacity capacity N/A N/A self keys N/A N/A N/A self cache N/A N/A __eq__ N/A N/A self other N/A N/A N/A Return equality with the config values that instantiate
        this instance.
         N/A N/A N/A False other N/A None other N/A N/A id self N/A id other N/A get N/A N/A self key N/A N/A N/A key N/A make_md5 N/A make_hashable key N/A N/A N/A N/A self cache get key None N/A set N/A N/A self key value N/A N/A N/A key N/A make_md5 N/A make_hashable key N/A N/A N/A self cache N/A key value N/A N/A N/A N/A N/A N/A self keys remove key N/A N/A N/A ValueError N/A N/A N/A N/A N/A N/A self keys append key N/A to_delete N/A N/A self keys N/A 0 N/A max 0 N/A N/A len N/A self keys N/A self capacity N/A N/A self keys N/A N/A self keys N/A N/A len to_delete N/A item to_delete N/A N/A N/A N/A self cache N/A item N/A N/A FilesystemCache N/A BaseCache N/A N/A Uses a temporary directory on the disk.
     N/A V 2 __init__ N/A N/A self directory new_file_mode N/A None N/A N/A N/A self directory directory N/A N/A self new_file_mode new_file_mode N/A __eq__ N/A N/A self other N/A N/A N/A Return equality with the config values
        that instantiate this instance.
         N/A N/A N/A True other N/A N/A self directory other N/A N/A id self N/A id other N/A get N/A N/A self key N/A N/A N/A filename N/A N/A path join N/A self directory N/A %s N/A make_md5 N/A self V key N/A N/A N/A f N/A open filename rb N/A N/A N/A IOError N/A e N/A N/A N/A N/A e errno N/A errno ENOENT N/A N/A N/A None N/A N/A N/A result N/A N/A f read N/A N/A N/A N/A f close N/A unpickled N/A safe_unpickle result N/A N/A unpickled None N/A N/A N/A N/A warnings warn N/A Ignoring corrupted cache file %s filename N/A unpickled N/A set N/A N/A self key data N/A N/A N/A md5 N/A %s N/A make_md5 N/A self V key N/A filename N/A N/A path join N/A self directory md5 N/A N/A fd temp_filename N/A N/A tempfile mkstemp prefix N/A . md5 dir N/A self directory N/A N/A N/A N/A N/A os fdopen fd wb f N/A N/A N/A N/A pickle dump data f N/A N/A N/A f flush N/A N/A N/A self new_file_mode None N/A N/A N/A N/A os chmod temp_filename N/A self new_file_mode N/A N/A N/A N/A os path isfile filename N/A N/A N/A N/A os unlink filename N/A N/A N/A os rename temp_filename filename N/A N/A N/A N/A N/A N/A os unlink temp_filename N/A N/A N/A get_cache N/A N/A option ctx N/A N/A N/A Return a cache instance based on ``option``.
     N/A N/A option N/A N/A None N/A N/A isinstance option BaseCache N/A N/A option N/A N/A N/A N/A isinstance option type N/A issubclass option BaseCache N/A N/A N/A option N/A N/A option True N/A N/A directory N/A N/A path join N/A ctx directory .webassets-cache N/A N/A N/A N/A path exists directory N/A N/A N/A N/A os makedirs directory N/A N/A directory option N/A N/A FilesystemCache directory N/A ctx cache_file_mode N/A