# Path: configmanager/base.py
# class ItemAttribute(object):
#     """
#     Class used in :class:`.Item` class to declare attributes of config items.
#     """
# 
#     def __init__(self, name, default=not_set, value=not_set, allow_dynamic_override=False):
#         self.name = name
#         self.default = default
#         self.value = value
#         self.attr_name = '_{}'.format(self.name)
# 
#         # If set to True, this becomes an expensive attribute because now when
#         # its value is requested we will check for a registered
#         # dynamic attribute with the same name and if available use the dynamic value instead of set value.
#         # Attributes that are used in majority of value calculation should avoid this.
#         # For example, envvar, which is consulted on every value request, is designed
#         # to be a cheap attribute. Users can, however, override envvar_name which is
#         # used only if envvar is set to True.
#         self.allow_dynamic_override = allow_dynamic_override
# 
#     def __set__(self, instance, value):
#         setattr(instance, self.attr_name, value)
# 
#     def __get__(self, instance, owner):
#         if self.allow_dynamic_override:
#             if instance.section:
#                 try:
#                     return instance.section.get_item_attribute(instance, self.name)
#                 except AttributeError:
#                     pass
#         return getattr(instance, self.attr_name, self.default)
# 
# class BaseItem(object):
#     is_item = True
#     is_section = False
#     is_config = False
# 
# Path: configmanager/exceptions.py
# class RequiredValueMissing(ConfigError):
#     """
#     Value was requested from an item which requires a value, but had no
#     default or custom value set.
# 
#     .. attribute:: name
# 
#         Name of the item
# 
#     .. attribute:: item
# 
#         :class:`.Item` instance
#     """
#     def __init__(self, name, item=None):
#         super(RequiredValueMissing, self).__init__(name)
#         self.name = name
#         self.item = item
# 
#     def __repr__(self):
#         return '<{} {!r} in {}>'.format(self.__class__.__name__, self.name, self.item)
# 
# Path: configmanager/item_types.py
# class _ItemType(object):
# class _NotSetType(_ItemType):
# class _StrType(_ItemType):
# class _IntType(_ItemType):
# class _BoolType(_ItemType):
# class _FloatType(_ItemType):
# class _DictType(_ItemType):
# class _ListType(_ItemType):
# class _Types(object):
#     def serialize(self, instance, **kwargs):
#     def deserialize(self, payload, **kwargs):
#     def includes(self, obj):
#     def accepts(self, obj):
#     def set_item_value(self, item, raw_value):
#     def __repr__(self):
#     def __eq__(self, other):
#     def includes(self, obj):
#     def includes(self, obj):
#     def accepts(self, obj):
#     def accepts(self, obj):
#     def deserialize(self, payload, **kwargs):
#     def serialize(self, instance, **kwargs):
#     def accepts(self, obj):
#     def __init__(self):
#     def guess(self, obj):
#     def translate(self, type_):
# 
# Path: configmanager/utils.py
# class _NotSet(object):
#     def __init__(self):
#     def __eq__(self, other):
#     def __nonzero__(self):
#     def __bool__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __deepcopy__(self, memodict):
#     def __copy__(self):
# def _get_persistence_adapter_for(filename):


from builtins import str
from .base import ItemAttribute, BaseItem
from .exceptions import RequiredValueMissing
from .item_types import Types
from .utils import not_set
import copy
import os
import six
        'I was here'

    If you pass attributes as *kwargs*, names prefixed with ``@`` symbol will have
    ``@`` removed and will be treated like normal attributes::

        >>> t = Item(**{'@name': 'threads', '@default': 5})
        >>> t.name
        'threads'
        >>> t.default
        5
        >>> t.type
        int
    """

    #: Name of the config item.
    name = ItemAttribute('name')

    #: Type of the config item's value, a callable. Defaults to string.
    type = ItemAttribute('type', default=Types.str)

    raw_str_value = ItemAttribute('raw_str_value')

    #: ``True`` if config item requires a value.
    #: Note that if an item has a default value, marking it as ``required`` will have no effect.
    required = ItemAttribute('required', default=False)

    #: If set to a string, will use that as the name of the environment variable and will not consult envvar_name.
    #: If set to True, will use value of envvar_name as the name of environment variable to check for value override.
    #: If set to True and envvar_name is not set, will use auto-generated name based on item's path
    #: in the configuration tree: SECTION1_SECTION2_ITEMNAME.

# Path: configmanager/base.py
# class ItemAttribute(object):
#     """
#     Class used in :class:`.Item` class to declare attributes of config items.
#     """
# 
#     def __init__(self, name, default=not_set, value=not_set, allow_dynamic_override=False):
#         self.name = name
#         self.default = default
#         self.value = value
#         self.attr_name = '_{}'.format(self.name)
# 
#         # If set to True, this becomes an expensive attribute because now when
#         # its value is requested we will check for a registered
#         # dynamic attribute with the same name and if available use the dynamic value instead of set value.
#         # Attributes that are used in majority of value calculation should avoid this.
#         # For example, envvar, which is consulted on every value request, is designed
#         # to be a cheap attribute. Users can, however, override envvar_name which is
#         # used only if envvar is set to True.
#         self.allow_dynamic_override = allow_dynamic_override
# 
#     def __set__(self, instance, value):
#         setattr(instance, self.attr_name, value)
# 
#     def __get__(self, instance, owner):
#         if self.allow_dynamic_override:
#             if instance.section:
#                 try:
#                     return instance.section.get_item_attribute(instance, self.name)
#                 except AttributeError:
#                     pass
#         return getattr(instance, self.attr_name, self.default)
# 
# class BaseItem(object):
#     is_item = True
#     is_section = False
#     is_config = False
# 
# Path: configmanager/exceptions.py
# class RequiredValueMissing(ConfigError):
#     """
#     Value was requested from an item which requires a value, but had no
#     default or custom value set.
# 
#     .. attribute:: name
# 
#         Name of the item
# 
#     .. attribute:: item
# 
#         :class:`.Item` instance
#     """
#     def __init__(self, name, item=None):
#         super(RequiredValueMissing, self).__init__(name)
#         self.name = name
#         self.item = item
# 
#     def __repr__(self):
#         return '<{} {!r} in {}>'.format(self.__class__.__name__, self.name, self.item)
# 
# Path: configmanager/item_types.py
# class _ItemType(object):
# class _NotSetType(_ItemType):
# class _StrType(_ItemType):
# class _IntType(_ItemType):
# class _BoolType(_ItemType):
# class _FloatType(_ItemType):
# class _DictType(_ItemType):
# class _ListType(_ItemType):
# class _Types(object):
#     def serialize(self, instance, **kwargs):
#     def deserialize(self, payload, **kwargs):
#     def includes(self, obj):
#     def accepts(self, obj):
#     def set_item_value(self, item, raw_value):
#     def __repr__(self):
#     def __eq__(self, other):
#     def includes(self, obj):
#     def includes(self, obj):
#     def accepts(self, obj):
#     def accepts(self, obj):
#     def deserialize(self, payload, **kwargs):
#     def serialize(self, instance, **kwargs):
#     def accepts(self, obj):
#     def __init__(self):
#     def guess(self, obj):
#     def translate(self, type_):
# 
# Path: configmanager/utils.py
# class _NotSet(object):
#     def __init__(self):
#     def __eq__(self, other):
#     def __nonzero__(self):
#     def __bool__(self):
#     def __str__(self):
#     def __repr__(self):
#     def __deepcopy__(self, memodict):
#     def __copy__(self):
# def _get_persistence_adapter_for(filename):


# Path: configmanager/items.py
from builtins import str
from .base import ItemAttribute, BaseItem
from .exceptions import RequiredValueMissing
from .item_types import Types
from .utils import not_set
import copy
import os
import six

        'I was here'

    If you pass attributes as *kwargs*, names prefixed with ``@`` symbol will have
    ``@`` removed and will be treated like normal attributes::

        >>> t = Item(**{'@name': 'threads', '@default': 5})
        >>> t.name
        'threads'
        >>> t.default
        5
        >>> t.type
        int
    """

    #: Name of the config item.
    name = ItemAttribute('name')

    #: Type of the config item's value, a callable. Defaults to string.
    type = ItemAttribute('type', default=Types.str)

    raw_str_value = ItemAttribute('raw_str_value')

    #: ``True`` if config item requires a value.
    #: Note that if an item has a default value, marking it as ``required`` will have no effect.
    required = ItemAttribute('required', default=False)

    #: If set to a string, will use that as the name of the environment variable and will not consult envvar_name.
    #: If set to True, will use value of envvar_name as the name of environment variable to check for value override.
    #: If set to True and envvar_name is not set, will use auto-generated name based on item's path
    #: in the configuration tree: SECTION1_SECTION2_ITEMNAME.

    envvar = ItemAttribute('envvar', default=None)