NotAvailable and NotLoaded should not be callable

This commit is contained in:
Florent 2014-03-18 11:51:02 +01:00
commit fc6f7d8c21

View file

@ -82,7 +82,10 @@ class AttributeCreationWarning(UserWarning):
"""
class NotAvailableMeta(type):
class NotAvailableType(object):
"""
NotAvailable is a constant to use on non available fields.
"""
def __str__(self):
return unicode(self).decode('utf-8')
@ -92,15 +95,17 @@ class NotAvailableMeta(type):
def __nonzero__(self):
return False
NotAvailable = NotAvailableType()
class NotAvailable(object):
class NotLoadedType(object):
"""
Constant to use on non available fields.
NotLoaded is a constant to use on not loaded fields.
When you use :func:`weboob.tools.backend.BaseBackend.fillobj` on a object based on :class:`CapBaseObject`,
it will request all fields with this value.
"""
__metaclass__ = NotAvailableMeta
class NotLoadedMeta(type):
def __str__(self):
return unicode(self).decode('utf-8')
@ -110,15 +115,7 @@ class NotLoadedMeta(type):
def __nonzero__(self):
return False
class NotLoaded(object):
"""
Constant to use on not loaded fields.
When you use :func:`weboob.tools.backend.BaseBackend.fillobj` on a object based on :class:`CapBaseObject`,
it will request all fields with this value.
"""
__metaclass__ = NotLoadedMeta
NotLoaded = NotLoadedType()
class IBaseCap(object):