Declare fields to avoid warnings

Also call the init of CapBaseObject. This should have been done
previously, though the usage of id=None isn't ideal. Maybe it should be
split_path.
This commit is contained in:
Laurent Bachelier 2012-11-08 10:38:26 +01:00 committed by Romain Bignon
commit c728dfa774

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>. # along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, UserError from .base import IBaseCap, CapBaseObject, UserError, StringField, Field
__all__ = ['ICapCollection', 'BaseCollection', 'Collection', 'CollectionNotFound'] __all__ = ['ICapCollection', 'BaseCollection', 'Collection', 'CollectionNotFound']
@ -39,6 +39,7 @@ class BaseCollection(CapBaseObject):
However, this probably will not work properly for now. However, this probably will not work properly for now.
""" """
def __init__(self, split_path): def __init__(self, split_path):
CapBaseObject.__init__(self, None)
self.split_path = split_path self.split_path = split_path
@property @property
@ -64,6 +65,9 @@ class Collection(BaseCollection):
Do not inherit from this class if you want to make a regular CapBaseObject Do not inherit from this class if you want to make a regular CapBaseObject
a Collection, use BaseCollection instead. a Collection, use BaseCollection instead.
""" """
title = StringField('Collection title')
split_path = Field('Full collection path', list)
def __init__(self, split_path, title=None): def __init__(self, split_path, title=None):
self.title = title self.title = title
BaseCollection.__init__(self, split_path) BaseCollection.__init__(self, split_path)