# Path: gears/utils.py
# class cached_property(object):
# 
#     def __init__(self, func):
#         self.func = func
#         self.__name__ = func.__name__
#         self.__doc__ = func.__doc__
#         self.__module__ = func.__module__
# 
#     def __get__(self, obj, type=None):
#         if obj is None:
#             return self
#         value = obj.__dict__.get(self.__name__, missing)
#         if value is missing:
#             value = self.func(obj)
#             obj.__dict__[self.__name__] = value
#         return value


import os
import re
from .utils import cached_property
# -*- coding: utf-8 -*-



class AssetAttributes(object):
    """Provides access to asset path properties. The attributes object is
    created with environment object and relative (or logical) asset path.

    Some properties may be useful or not, depending on the type of passed path.
    If it is a relative asset path, you can use all properties except
    :attr:`search_paths`. In case of a logical asset path it makes sense to
    use only those properties that are not related to processors and compressor.

    :param environment: an instance of :class:`~gears.environment.Environment`
                        class.
    :param path: a relative or logical path of the asset.
    """

    def __init__(self, environment, path):
        #: Used to access the registries of compilers, processors, etc.
        #: It can be also used by asset. See
        #: :class:`~gears.environment.Environment` for more information.
        self.environment = environment

        #: The relative (or logical) path to asset.
        self.path = path

        #: The relative path to the directory the asset.
        self.dirname = os.path.dirname(path)


# Path: gears/utils.py
# class cached_property(object):
# 
#     def __init__(self, func):
#         self.func = func
#         self.__name__ = func.__name__
#         self.__doc__ = func.__doc__
#         self.__module__ = func.__module__
# 
#     def __get__(self, obj, type=None):
#         if obj is None:
#             return self
#         value = obj.__dict__.get(self.__name__, missing)
#         if value is missing:
#             value = self.func(obj)
#             obj.__dict__[self.__name__] = value
#         return value


# Path: gears/asset_attributes.py
import os
import re
from .utils import cached_property

# -*- coding: utf-8 -*-



class AssetAttributes(object):
    """Provides access to asset path properties. The attributes object is
    created with environment object and relative (or logical) asset path.

    Some properties may be useful or not, depending on the type of passed path.
    If it is a relative asset path, you can use all properties except
    :attr:`search_paths`. In case of a logical asset path it makes sense to
    use only those properties that are not related to processors and compressor.

    :param environment: an instance of :class:`~gears.environment.Environment`
                        class.
    :param path: a relative or logical path of the asset.
    """

    def __init__(self, environment, path):
        #: Used to access the registries of compilers, processors, etc.
        #: It can be also used by asset. See
        #: :class:`~gears.environment.Environment` for more information.
        self.environment = environment

        #: The relative (or logical) path to asset.
        self.path = path

        #: The relative path to the directory the asset.
        self.dirname = os.path.dirname(path)


    @cached_property