# Path: m2core/utils/voluptuous_checkers.py
# def NotNone(msg=None):
#     """Checks that value is not None neither empty string"""
#     def f(v):
#         if v is not None:
#             if type(v) == str:
#                 if v == '':
#                     raise Error(msg or "value must be not empty")
#                 else:
#                     return v
#             return v
#         else:
#             raise Error(msg or "value must be not None")
#     return f


import re
from voluptuous import Schema, Required, Coerce, Boolean, Length, All, Range, In
from voluptuous.error import Error
from m2core.utils.voluptuous_checkers import NotNone
            return r'(?P<%s>[01])' % self._attr_name

        if self._attr_type == 'int':
            return r'(?P<%s>[0-9]+)' % self._attr_name

        if self._attr_type == 'float':
            return r'(?P<%s>[0-9,.]+)' % self._attr_name

        if self._attr_type == 'string':
            # take my excuses for concatenation - it's because of the `%` symbol
            return r'(?P<' + self._attr_name + '>[^/+?$]+)'

    def params(self):
        """
        dict() with parsed attribute params
        """
        return {
            # 'attribute_name': self._attr_name,
            'attribute_type': self._attr_type,
            'length_limit': self._len_limit,
            'second_params': self._second_param,
        }

    def name(self):
        """
        Attribute name
        """
        return self._attr_name

    def _bool_validator(self):

# Path: m2core/utils/voluptuous_checkers.py
# def NotNone(msg=None):
#     """Checks that value is not None neither empty string"""
#     def f(v):
#         if v is not None:
#             if type(v) == str:
#                 if v == '':
#                     raise Error(msg or "value must be not empty")
#                 else:
#                     return v
#             return v
#         else:
#             raise Error(msg or "value must be not None")
#     return f


# Path: m2core/utils/url_parser.py
import re
from voluptuous import Schema, Required, Coerce, Boolean, Length, All, Range, In
from voluptuous.error import Error
from m2core.utils.voluptuous_checkers import NotNone

            return r'(?P<%s>[01])' % self._attr_name

        if self._attr_type == 'int':
            return r'(?P<%s>[0-9]+)' % self._attr_name

        if self._attr_type == 'float':
            return r'(?P<%s>[0-9,.]+)' % self._attr_name

        if self._attr_type == 'string':
            # take my excuses for concatenation - it's because of the `%` symbol
            return r'(?P<' + self._attr_name + '>[^/+?$]+)'

    def params(self):
        """
        dict() with parsed attribute params
        """
        return {
            # 'attribute_name': self._attr_name,
            'attribute_type': self._attr_type,
            'length_limit': self._len_limit,
            'second_params': self._second_param,
        }

    def name(self):
        """
        Attribute name
        """
        return self._attr_name

    def _bool_validator(self):

        return {Required(self._attr_name): All(NotNone(msg='<%s> should be not None' % self._attr_name), Boolean())}