rename CapBaseObject to BaseObject (refs #1424)

This commit is contained in:
Romain Bignon 2014-07-05 17:26:05 +02:00
commit 51958135cb
44 changed files with 183 additions and 183 deletions

View file

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from .base import UserError, NotLoaded, NotAvailable, CapBaseObject, IBaseCap
from .base import UserError, NotLoaded, NotAvailable, BaseObject, IBaseCap
__all__ = ['UserError', 'NotLoaded', 'NotAvailable', 'CapBaseObject', 'IBaseCap']
__all__ = ['UserError', 'NotLoaded', 'NotAvailable', 'BaseObject', 'IBaseCap']

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, StringField, Field, UserError
from .base import IBaseCap, BaseObject, StringField, Field, UserError
__all__ = ['AccountRegisterError', 'Account', 'StatusField', 'ICapAccount']
@ -30,7 +30,7 @@ class AccountRegisterError(UserError):
"""
class Account(CapBaseObject):
class Account(BaseObject):
"""
Describe an account and its properties.
"""
@ -39,7 +39,7 @@ class Account(CapBaseObject):
properties = Field('List of key/value properties', dict)
def __init__(self, id=None):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
class StatusField(object):

View file

@ -22,7 +22,7 @@ import re
from datetime import timedelta
from .image import BaseImage
from .base import Field, StringField, IntField, CapBaseObject
from .base import Field, StringField, IntField, BaseObject
from .file import ICapFile, BaseFile
@ -44,7 +44,7 @@ def decode_id(decode_id):
return wrapper
class Album(CapBaseObject):
class Album(BaseObject):
"""
Represent an album
"""
@ -55,7 +55,7 @@ class Album(CapBaseObject):
tracks_list = Field('list of tracks', list)
def __init__(self, _id):
CapBaseObject.__init__(self, unicode("album.%s" % _id))
BaseObject.__init__(self, unicode("album.%s" % _id))
@classmethod
def decode_id(cls, _id):
@ -66,7 +66,7 @@ class Album(CapBaseObject):
return _id
class Playlist(CapBaseObject):
class Playlist(BaseObject):
"""
Represent a playlist
"""
@ -74,7 +74,7 @@ class Playlist(CapBaseObject):
tracks_list = Field('list of tracks', list)
def __init__(self, _id):
CapBaseObject.__init__(self, unicode("playlist.%s" % _id))
BaseObject.__init__(self, unicode("playlist.%s" % _id))
@classmethod
def decode_id(cls, _id):

View file

@ -24,7 +24,7 @@ import re
from weboob.tools.compat import basestring, long
from .base import CapBaseObject, Field, StringField, DateField, DecimalField, IntField, UserError, Currency
from .base import BaseObject, Field, StringField, DateField, DecimalField, IntField, UserError, Currency
from .collection import ICapCollection
@ -46,7 +46,7 @@ class TransferError(UserError):
"""
class Recipient(CapBaseObject, Currency):
class Recipient(BaseObject, Currency):
"""
Recipient of a transfer.
"""
@ -55,7 +55,7 @@ class Recipient(CapBaseObject, Currency):
currency = StringField('Currency', default=None)
def __init__(self):
CapBaseObject.__init__(self, 0)
BaseObject.__init__(self, 0)
@property
def currency_text(self):
@ -86,7 +86,7 @@ class Account(Recipient):
return u"<Account id=%r label=%r>" % (self.id, self.label)
class Transaction(CapBaseObject):
class Transaction(BaseObject):
"""
Bank transaction.
"""
@ -131,7 +131,7 @@ class Transaction(CapBaseObject):
return "%08x" % (crc & 0xffffffff)
class Investment(CapBaseObject):
class Investment(BaseObject):
"""
Investment in a financial market.
"""
@ -145,7 +145,7 @@ class Investment(CapBaseObject):
diff = DecimalField('Difference between the buy cost and the current valuation')
class Transfer(CapBaseObject):
class Transfer(BaseObject):
"""
Transfer from an account to a recipient.
"""
@ -169,7 +169,7 @@ class ICapBank(ICapCollection):
all accounts (by calling :func:`iter_accounts`).
:param objs: type of objects to get
:type objs: tuple[:class:`CapBaseObject`]
:type objs: tuple[:class:`BaseObject`]
:param split_path: path to discover
:type split_path: :class:`list`
:rtype: iter[:class:`BaseCapObject`]

View file

@ -33,7 +33,7 @@ from weboob.tools.ordereddict import OrderedDict
__all__ = ['UserError', 'FieldNotFound', 'NotAvailable',
'NotLoaded', 'IBaseCap', 'Field', 'IntField', 'DecimalField',
'FloatField', 'StringField', 'BytesField', 'DateField',
'DeltaField', 'empty', 'CapBaseObject']
'DeltaField', 'empty', 'BaseObject']
def empty(value):
@ -76,7 +76,7 @@ class FieldNotFound(Exception):
A field isn't found.
:param obj: object
:type obj: :class:`CapBaseObject`
:type obj: :class:`BaseObject`
:param field: field not found
:type field: :class:`Field`
"""
@ -126,7 +126,7 @@ class NotLoadedType(object):
"""
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`,
When you use :func:`weboob.tools.backend.BaseBackend.fillobj` on a object based on :class:`BaseObject`,
it will request all fields with this value.
"""
@ -155,13 +155,13 @@ class IBaseCap(object):
A capability may define abstract methods (which raise :class:`NotImplementedError`)
with an explicit docstring to tell backends how to implement them.
Also, it may define some *objects*, using :class:`CapBaseObject`.
Also, it may define some *objects*, using :class:`BaseObject`.
"""
class Field(object):
"""
Field of a :class:`CapBaseObject` class.
Field of a :class:`BaseObject` class.
:param doc: docstring of the field
:type doc: :class:`str`
@ -284,12 +284,12 @@ class DeltaField(Field):
Field.__init__(self, doc, datetime.timedelta, **kwargs)
class _CapBaseObjectMeta(type):
class _BaseObjectMeta(type):
def __new__(cls, name, bases, attrs):
fields = [(field_name, attrs.pop(field_name)) for field_name, obj in attrs.items() if isinstance(obj, Field)]
fields.sort(key=lambda x: x[1]._creation_counter)
new_class = super(_CapBaseObjectMeta, cls).__new__(cls, name, bases, attrs)
new_class = super(_BaseObjectMeta, cls).__new__(cls, name, bases, attrs)
if new_class._fields is None:
new_class._fields = OrderedDict()
else:
@ -306,7 +306,7 @@ class _CapBaseObjectMeta(type):
return new_class
class CapBaseObject(object):
class BaseObject(object):
"""
This is the base class for a capability object.
@ -319,7 +319,7 @@ class CapBaseObject(object):
For example::
class Transfer(CapBaseObject):
class Transfer(BaseObject):
" Transfer from an account to a recipient. "
amount = DecimalField('Amount to transfer')
@ -330,7 +330,7 @@ class CapBaseObject(object):
The docstring is mandatory.
"""
__metaclass__ = _CapBaseObjectMeta
__metaclass__ = _BaseObjectMeta
id = None
backend = None
@ -394,7 +394,7 @@ class CapBaseObject(object):
yield name, field.value
def __eq__(self, obj):
if isinstance(obj, CapBaseObject):
if isinstance(obj, BaseObject):
return self.backend == obj.backend and self.id == obj.id
else:
return False

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import CapBaseObject, StringField, DateField, DecimalField, UserError
from .base import BaseObject, StringField, DateField, DecimalField, UserError
from .collection import ICapCollection
@ -41,7 +41,7 @@ class BillNotFound(UserError):
UserError.__init__(self, msg)
class Detail(CapBaseObject):
class Detail(BaseObject):
"""
Detail of a subscription
"""
@ -55,10 +55,10 @@ class Detail(CapBaseObject):
unit = StringField('Unit of the consumption')
def __init__(self):
CapBaseObject.__init__(self, 0)
BaseObject.__init__(self, 0)
class Bill(CapBaseObject):
class Bill(BaseObject):
"""
Bill.
"""
@ -73,10 +73,10 @@ class Bill(CapBaseObject):
finishdate = DateField('The last day the bill applies to')
def __init__(self):
CapBaseObject.__init__(self, 0)
BaseObject.__init__(self, 0)
class Subscription(CapBaseObject):
class Subscription(BaseObject):
"""
Subscription to a service.
"""

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, Field, StringField, DateField, \
from .base import IBaseCap, BaseObject, Field, StringField, DateField, \
IntField, DeltaField, UserError
@ -32,7 +32,7 @@ class IssueError(UserError):
"""
class Project(CapBaseObject):
class Project(BaseObject):
"""
Represents a project.
"""
@ -45,7 +45,7 @@ class Project(CapBaseObject):
priorities = Field('Available priorities for issues', list)
def __init__(self, id, name):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.name = unicode(name)
def __repr__(self):
@ -105,35 +105,35 @@ class Project(CapBaseObject):
return None
class User(CapBaseObject):
class User(BaseObject):
"""
User.
"""
name = StringField('Name of user')
def __init__(self, id, name):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.name = unicode(name)
def __repr__(self):
return '<User %r>' % self.name
class Version(CapBaseObject):
class Version(BaseObject):
"""
Version of a project.
"""
name = StringField('Name of version')
def __init__(self, id, name):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.name = unicode(name)
def __repr__(self):
return '<Version %r>' % self.name
class Status(CapBaseObject):
class Status(BaseObject):
"""
Status of an issue.
@ -149,7 +149,7 @@ class Status(CapBaseObject):
value = IntField('Value of status (constants VALUE_*)')
def __init__(self, id, name, value):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.name = unicode(name)
self.value = value
@ -157,7 +157,7 @@ class Status(CapBaseObject):
return '<Status %r>' % self.name
class Attachment(CapBaseObject):
class Attachment(BaseObject):
"""
Attachment of an issue.
"""
@ -168,7 +168,7 @@ class Attachment(CapBaseObject):
return '<Attachment %r>' % self.filename
class Change(CapBaseObject):
class Change(BaseObject):
"""
A change of an update.
"""
@ -177,7 +177,7 @@ class Change(CapBaseObject):
new = StringField('New value of field')
class Update(CapBaseObject):
class Update(BaseObject):
"""
Represents an update of an issue.
"""
@ -192,7 +192,7 @@ class Update(CapBaseObject):
return '<Update %r>' % self.id
class Issue(CapBaseObject):
class Issue(BaseObject):
"""
Represents an issue.
"""
@ -215,7 +215,7 @@ class Issue(CapBaseObject):
priority = StringField('Priority of the issue') #XXX
class Query(CapBaseObject):
class Query(BaseObject):
"""
Query to find an issue.
"""
@ -228,7 +228,7 @@ class Query(CapBaseObject):
status = StringField('Filter on statuses')
def __init__(self):
CapBaseObject.__init__(self, '')
BaseObject.__init__(self, '')
class ICapBugTracker(IBaseCap):

View file

@ -17,7 +17,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import CapBaseObject, StringField, DateField, IntField, FloatField, Field
from .base import BaseObject, StringField, DateField, IntField, FloatField, Field
from .collection import ICapCollection, CollectionNotFound, Collection
from datetime import time, datetime
@ -45,7 +45,7 @@ TRANSP = enum(OPAQUE=u'OPAQUE', TRANSPARENT=u'TRANSPARENT')
STATUS = enum(TENTATIVE=u'TENTATIVE', CONFIRMED=u'CONFIRMED', CANCELLED=u'CANCELLED')
class BaseCalendarEvent(CapBaseObject):
class BaseCalendarEvent(BaseObject):
"""
Represents a calendar event
"""
@ -85,7 +85,7 @@ class BaseCalendarEvent(CapBaseObject):
return self.id2url(self.id)
class Query(CapBaseObject):
class Query(BaseObject):
"""
Query to find events
"""
@ -96,7 +96,7 @@ class Query(CapBaseObject):
categories = Field('List of categories of the event', list, tuple)
def __init__(self):
CapBaseObject.__init__(self, '')
BaseObject.__init__(self, '')
self.categories = []
for value in CATEGORIES.values:
self.categories.append(value)

View file

@ -20,7 +20,7 @@
import datetime
from .base import IBaseCap, CapBaseObject, StringField, DateField, UserError
from .base import IBaseCap, BaseObject, StringField, DateField, UserError
__all__ = ['ChatException', 'ChatMessage', 'ICapChat']
@ -32,7 +32,7 @@ class ChatException(UserError):
"""
class ChatMessage(CapBaseObject):
class ChatMessage(BaseObject):
"""
Message on the chat.
"""
@ -42,7 +42,7 @@ class ChatMessage(CapBaseObject):
date = DateField('Date when the message has been sent')
def __init__(self, id_from, id_to, message, date=None):
CapBaseObject.__init__(self, '%s.%s' % (id_from, id_to))
BaseObject.__init__(self, '%s.%s' % (id_from, id_to))
self.id_from = id_from
self.id_to = id_to
self.message = message

View file

@ -18,13 +18,13 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, DateField, StringField, IntField, Field
from .base import IBaseCap, BaseObject, DateField, StringField, IntField, Field
__all__ = ['Movie', 'Person', 'ICapCinema']
class Movie(CapBaseObject):
class Movie(BaseObject):
"""
Movie object.
"""
@ -42,11 +42,11 @@ class Movie(CapBaseObject):
thumbnail_url = StringField('Url of movie thumbnail')
def __init__(self, id, original_title):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.original_title = original_title
class Person(CapBaseObject):
class Person(BaseObject):
"""
Person object.
"""
@ -64,7 +64,7 @@ class Person(CapBaseObject):
thumbnail_url = StringField('Url of person thumbnail')
def __init__(self, id, name):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.name = name

View file

@ -19,7 +19,7 @@
from weboob.tools.ordereddict import OrderedDict
from .base import IBaseCap, CapBaseObject, UserError, StringField, Field
from .base import IBaseCap, BaseObject, UserError, StringField, Field
__all__ = ['ICapCollection', 'BaseCollection', 'Collection', 'CollectionNotFound']
@ -34,13 +34,13 @@ class CollectionNotFound(UserError):
UserError.__init__(self, msg)
class BaseCollection(CapBaseObject):
class BaseCollection(BaseObject):
"""
Inherit from this if you want to create an object that is *also* a Collection.
However, this probably will not work properly for now.
"""
def __init__(self, split_path):
CapBaseObject.__init__(self, None)
BaseObject.__init__(self, None)
self.split_path = split_path
@property
@ -76,7 +76,7 @@ class Collection(BaseCollection):
It is a dumb object, it must not contain callbacks to a backend.
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 BaseObject
a Collection, use BaseCollection instead.
"""
title = StringField('Collection title')

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, Field, StringField, BytesField, IntField, \
from .base import IBaseCap, BaseObject, Field, StringField, BytesField, IntField, \
UserError
from weboob.tools.ordereddict import OrderedDict
@ -44,7 +44,7 @@ class ProfileNode(object):
return self.value[key]
class ContactPhoto(CapBaseObject):
class ContactPhoto(BaseObject):
"""
Photo of a contact.
"""
@ -56,7 +56,7 @@ class ContactPhoto(CapBaseObject):
hidden = Field('True if the photo is hidden on website', bool)
def __init__(self, name):
CapBaseObject.__init__(self, name)
BaseObject.__init__(self, name)
self.name = name
def __iscomplete__(self):
@ -71,7 +71,7 @@ class ContactPhoto(CapBaseObject):
len(self.thumbnail_data) if self.thumbnail_data else 0)
class Contact(CapBaseObject):
class Contact(BaseObject):
"""
A contact.
"""
@ -89,7 +89,7 @@ class Contact(CapBaseObject):
profile = Field('Contact profile', dict)
def __init__(self, id, name, status):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.name = name
self.status = status
@ -154,14 +154,14 @@ class QueryError(UserError):
"""
class Query(CapBaseObject):
class Query(BaseObject):
"""
Query to send to a contact.
"""
message = StringField('Message received')
def __init__(self, id, message):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.message = message

View file

@ -18,13 +18,13 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, StringField, DateField, Field
from .base import IBaseCap, BaseObject, StringField, DateField, Field
__all__ = ['Content', 'Revision', 'ICapContent']
class Content(CapBaseObject):
class Content(BaseObject):
"""
Content object.
"""
@ -34,7 +34,7 @@ class Content(CapBaseObject):
revision = StringField('ID of revision')
class Revision(CapBaseObject):
class Revision(BaseObject):
"""
Revision of a change on a content.
"""

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, Field, StringField, DateField, UserError
from .base import IBaseCap, BaseObject, Field, StringField, DateField, UserError
from .contact import Contact
@ -79,7 +79,7 @@ class Optimization(object):
raise NotImplementedError()
class Event(CapBaseObject):
class Event(BaseObject):
"""
A dating event (for example a visite, a query received, etc.)
"""

View file

@ -18,13 +18,13 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, NotAvailable, Field, StringField, DateField
from .base import IBaseCap, BaseObject, NotAvailable, Field, StringField, DateField
__all__ = ['BaseFile', 'ICapFile']
class BaseFile(CapBaseObject):
class BaseFile(BaseObject):
"""
Represent a file.
"""

View file

@ -19,13 +19,13 @@
from weboob.tools.capabilities.thumbnail import Thumbnail
from .base import IBaseCap, CapBaseObject, NotLoaded, Field, StringField, \
from .base import IBaseCap, BaseObject, NotLoaded, Field, StringField, \
BytesField, IntField, FloatField, DateField
__all__ = ['BaseGallery', 'BaseImage', 'ICapGallery']
class BaseGallery(CapBaseObject):
class BaseGallery(BaseObject):
"""
Represents a gallery.
@ -42,7 +42,7 @@ class BaseGallery(CapBaseObject):
def __init__(self, _id, title=NotLoaded, url=NotLoaded, cardinality=NotLoaded, date=NotLoaded,
rating=NotLoaded, rating_max=NotLoaded, thumbnail=NotLoaded, thumbnail_url=None, nsfw=False):
CapBaseObject.__init__(self, unicode(_id))
BaseObject.__init__(self, unicode(_id))
self.title = title
self.url = url
@ -70,7 +70,7 @@ class BaseGallery(CapBaseObject):
raise NotImplementedError()
class BaseImage(CapBaseObject):
class BaseImage(BaseObject):
"""
Base class for images.
"""
@ -84,7 +84,7 @@ class BaseImage(CapBaseObject):
def __init__(self, _id, index=None, thumbnail=NotLoaded, url=NotLoaded,
ext=NotLoaded, gallery=None):
CapBaseObject.__init__(self, unicode(_id))
BaseObject.__init__(self, unicode(_id))
self.index = index
self.thumbnail = thumbnail

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, StringField, FloatField, DateField, Field, UserError, empty
from .base import IBaseCap, BaseObject, StringField, FloatField, DateField, Field, UserError, empty
__all__ = ['Gauge', 'GaugeSensor', 'GaugeMeasure', 'ICapGauge', 'SensorNotFound']
@ -29,7 +29,7 @@ class SensorNotFound(UserError):
"""
class Gauge(CapBaseObject):
class Gauge(BaseObject):
"""
Gauge class.
"""
@ -39,7 +39,7 @@ class Gauge(CapBaseObject):
sensors = Field('List of sensors on the gauge', list)
class GaugeMeasure(CapBaseObject):
class GaugeMeasure(BaseObject):
"""
Measure of a gauge sensor.
"""
@ -48,7 +48,7 @@ class GaugeMeasure(CapBaseObject):
alarm = StringField('Alarm level')
def __init__(self):
CapBaseObject.__init__(self)
BaseObject.__init__(self)
def __repr__(self):
if empty(self.level):
@ -57,7 +57,7 @@ class GaugeMeasure(CapBaseObject):
return "<GaugeMeasure level=%f alarm=%s date=%s>" % (self.level, self.alarm, self.date)
class GaugeSensor(CapBaseObject):
class GaugeSensor(BaseObject):
"""
GaugeSensor class.
"""

View file

@ -18,13 +18,13 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, StringField, FloatField
from .base import IBaseCap, BaseObject, StringField, FloatField
__all__ = ['IpLocation', 'ICapGeolocIp']
class IpLocation(CapBaseObject):
class IpLocation(BaseObject):
"""
Represents the location of an IP address.
"""
@ -39,7 +39,7 @@ class IpLocation(CapBaseObject):
isp = StringField('Internet Service Provider')
def __init__(self, ipaddr):
CapBaseObject.__init__(self, ipaddr)
BaseObject.__init__(self, ipaddr)
class ICapGeolocIp(IBaseCap):

View file

@ -18,14 +18,14 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, Field, IntField, DecimalField, \
from .base import IBaseCap, BaseObject, Field, IntField, DecimalField, \
StringField, BytesField, DateField
__all__ = ['HousingPhoto', 'Housing', 'Query', 'City', 'ICapHousing']
class HousingPhoto(CapBaseObject):
class HousingPhoto(BaseObject):
"""
Photo of a housing.
"""
@ -33,7 +33,7 @@ class HousingPhoto(CapBaseObject):
data = BytesField('Data of photo')
def __init__(self, url):
CapBaseObject.__init__(self, url.split('/')[-1])
BaseObject.__init__(self, url.split('/')[-1])
self.url = url
def __iscomplete__(self):
@ -46,7 +46,7 @@ class HousingPhoto(CapBaseObject):
return u'<HousingPhoto "%s" data=%do>' % (self.id, len(self.data) if self.data else 0)
class Housing(CapBaseObject):
class Housing(BaseObject):
"""
Content of a housing.
"""
@ -63,7 +63,7 @@ class Housing(CapBaseObject):
details = Field('Key/values of details', dict)
class Query(CapBaseObject):
class Query(BaseObject):
"""
Query to find housings.
"""
@ -79,10 +79,10 @@ class Query(CapBaseObject):
nb_rooms = IntField('Number of rooms')
def __init__(self):
CapBaseObject.__init__(self, '')
BaseObject.__init__(self, '')
class City(CapBaseObject):
class City(BaseObject):
"""
City.
"""

View file

@ -17,12 +17,12 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import CapBaseObject, IBaseCap, StringField, DateField
from .base import BaseObject, IBaseCap, StringField, DateField
__all__ = ['BaseJobAdvert', 'ICapJob']
class BaseJobAdvert(CapBaseObject):
class BaseJobAdvert(BaseObject):
"""
Represents a job announce.
"""

View file

@ -18,13 +18,13 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .collection import ICapCollection
from .base import CapBaseObject, Field, StringField, DateField
from .base import BaseObject, Field, StringField, DateField
__all__ = ['Book', 'Renew', 'ICapBook']
class Book(CapBaseObject):
class Book(BaseObject):
"""
Describes a book.
"""
@ -35,7 +35,7 @@ class Book(CapBaseObject):
late = Field('Are you late?', bool)
class Renew(CapBaseObject):
class Renew(BaseObject):
"""
A renew message.
"""

View file

@ -18,13 +18,13 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, StringField
from .base import IBaseCap, BaseObject, StringField
__all__ = ['SongLyrics', 'ICapLyrics']
class SongLyrics(CapBaseObject):
class SongLyrics(BaseObject):
"""
Song lyrics object.
"""
@ -33,7 +33,7 @@ class SongLyrics(CapBaseObject):
content = StringField('Lyrics of the song')
def __init__(self, id, title):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.title = title

View file

@ -21,7 +21,7 @@
import datetime
import time
from .base import IBaseCap, CapBaseObject, NotLoaded, Field, StringField, \
from .base import IBaseCap, BaseObject, NotLoaded, Field, StringField, \
DateField, IntField, UserError
@ -30,12 +30,12 @@ __all__ = ['Thread', 'Message', 'ICapMessages', 'CantSendMessage', 'ICapMessages
# Message and Thread's attributes refer to themselves, and it isn't possible
# in python, so these base classes are used instead.
class _Message(CapBaseObject):
class _Message(BaseObject):
""" Base message. """
pass
class _Thread(CapBaseObject):
class _Thread(BaseObject):
""" Base Thread. """
pass
@ -71,7 +71,7 @@ class Message(_Message):
signature=NotLoaded,
children=NotLoaded,
flags=0):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.thread = thread
self.title = title
self.sender = sender

View file

@ -18,10 +18,10 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, Field, StringField, DateField
from .base import IBaseCap, BaseObject, Field, StringField, DateField
class Event(CapBaseObject):
class Event(BaseObject):
date = DateField('Date')
activity = StringField('Activity')
location = StringField('Location')
@ -29,7 +29,7 @@ class Event(CapBaseObject):
def __repr__(self):
return u'<Event date=%r activity=%r location=%r>' % (self.date, self.activity, self.location)
class Parcel(CapBaseObject):
class Parcel(BaseObject):
STATUS_UNKNOWN = 0
STATUS_PLANNED = 1
STATUS_IN_TRANSIT = 2

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, NotLoaded, Field, StringField, UserError
from .base import IBaseCap, BaseObject, NotLoaded, Field, StringField, UserError
__all__ = ['PasteNotFound', 'BasePaste', 'ICapPaste']
@ -32,7 +32,7 @@ class PasteNotFound(UserError):
return super(PasteNotFound, self).__init__("Paste not found")
class BasePaste(CapBaseObject):
class BasePaste(BaseObject):
"""
Represents a pasted text.
"""
@ -43,7 +43,7 @@ class BasePaste(CapBaseObject):
def __init__(self, _id, title=NotLoaded, language=NotLoaded, contents=NotLoaded,
public=NotLoaded):
CapBaseObject.__init__(self, unicode(_id))
BaseObject.__init__(self, unicode(_id))
self.title = title
self.language = language

View file

@ -18,21 +18,21 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, Field, DecimalField, \
from .base import IBaseCap, BaseObject, Field, DecimalField, \
StringField, DateField
__all__ = ['Shop', 'Price', 'Product', 'ICapPriceComparison']
class Product(CapBaseObject):
class Product(BaseObject):
"""
A product.
"""
name = StringField('Name of product')
class Shop(CapBaseObject):
class Shop(BaseObject):
"""
A shop where the price is.
"""
@ -41,7 +41,7 @@ class Shop(CapBaseObject):
info = StringField('Information about the shop')
class Price(CapBaseObject):
class Price(BaseObject):
"""
Price.
"""

View file

@ -19,14 +19,14 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, Field, StringField
from .base import IBaseCap, BaseObject, Field, StringField
from weboob.tools.capabilities.streaminfo import StreamInfo
__all__ = ['Radio', 'ICapRadio']
class Radio(CapBaseObject):
class Radio(BaseObject):
"""
Radio object.
"""

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, StringField, IntField, Field, empty
from .base import IBaseCap, BaseObject, StringField, IntField, Field, empty
import lxml.etree as ET
@ -47,7 +47,7 @@ class Comment():
return result
class Recipe(CapBaseObject):
class Recipe(BaseObject):
"""
Recipe object.
"""
@ -64,7 +64,7 @@ class Recipe(CapBaseObject):
comments = Field('User comments about the recipe', list)
def __init__(self, id, title):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.title = title
def toKrecipesXml(self, author=None):

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, StringField, IntField, UserError
from .base import IBaseCap, BaseObject, StringField, IntField, UserError
__all__ = ['Subtitle', 'ICapSubtitle']
@ -33,7 +33,7 @@ class LanguageNotSupported(UserError):
UserError.__init__(self, msg)
class Subtitle(CapBaseObject):
class Subtitle(BaseObject):
"""
Subtitle object.
"""
@ -45,7 +45,7 @@ class Subtitle(CapBaseObject):
description=StringField('Description of corresponding video')
def __init__(self, id, name):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.name = name
class ICapSubtitle(IBaseCap):

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, Field, StringField, FloatField, \
from .base import IBaseCap, BaseObject, Field, StringField, FloatField, \
DateField, IntField, UserError
@ -34,7 +34,7 @@ class MagnetOnly(UserError):
UserError.__init__(self, 'Only magnet URL is available')
class Torrent(CapBaseObject):
class Torrent(BaseObject):
"""
Torrent object.
"""
@ -50,7 +50,7 @@ class Torrent(CapBaseObject):
filename = StringField('Name of .torrent file')
def __init__(self, id, name):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.name = name

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .base import IBaseCap, CapBaseObject, StringField, UserError
from .base import IBaseCap, BaseObject, StringField, UserError
__all__ = ['TranslationFail', 'LanguageNotSupported', 'ICapTranslate']
@ -42,7 +42,7 @@ class TranslationFail(UserError):
UserError.__init__(self, msg)
class Translation(CapBaseObject):
class Translation(BaseObject):
"""
Translation.
"""

View file

@ -20,28 +20,28 @@
import datetime
from .base import IBaseCap, CapBaseObject, StringField, TimeField, DeltaField, \
from .base import IBaseCap, BaseObject, StringField, TimeField, DeltaField, \
DateField, DecimalField, UserError
__all__ = ['Station', 'Departure', 'RoadStep', 'RoadmapError', 'RoadmapFilters', 'ICapTravel']
class Station(CapBaseObject):
class Station(BaseObject):
"""
Describes a station.
"""
name = StringField('Name of station')
def __init__(self, id, name):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.name = name
def __repr__(self):
return "<Station id=%r name=%r>" % (self.id, self.name)
class Departure(CapBaseObject):
class Departure(BaseObject):
"""
Describes a departure.
"""
@ -57,7 +57,7 @@ class Departure(CapBaseObject):
currency = StringField('Currency', default=None)
def __init__(self, id, _type, _time):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.type = _type
self.time = _time
@ -67,7 +67,7 @@ class Departure(CapBaseObject):
self.id, self.type, self.time.strftime('%H:%M'), self.departure_station, self.arrival_station)
class RoadStep(CapBaseObject):
class RoadStep(BaseObject):
"""
A step on a roadmap.
"""
@ -85,7 +85,7 @@ class RoadmapError(UserError):
"""
class RoadmapFilters(CapBaseObject):
class RoadmapFilters(BaseObject):
"""
Filters to get a roadmap.
"""
@ -93,7 +93,7 @@ class RoadmapFilters(CapBaseObject):
arrival_time = DateField('Wanted arrival time')
def __init__(self):
CapBaseObject.__init__(self, '')
BaseObject.__init__(self, '')
class ICapTravel(IBaseCap):

View file

@ -20,20 +20,20 @@
from datetime import datetime, date
from .base import IBaseCap, CapBaseObject, Field, DateField, FloatField, \
from .base import IBaseCap, BaseObject, Field, DateField, FloatField, \
StringField, UserError
__all__ = ['Forecast', 'Current', 'City', 'CityNotFound', 'Temperature', 'ICapWeather']
class Temperature(CapBaseObject):
class Temperature(BaseObject):
value = FloatField('Temperature value')
unit = StringField('Input unit')
def __init__(self, value, unit = u''):
CapBaseObject.__init__(self, value)
BaseObject.__init__(self, value)
self.value = value
if unit not in [u'C', u'F']:
unit = u''
@ -60,7 +60,7 @@ class Temperature(CapBaseObject):
return u'%s %s' % (self.value, self.unit)
class Forecast(CapBaseObject):
class Forecast(BaseObject):
"""
Weather forecast.
"""
@ -70,14 +70,14 @@ class Forecast(CapBaseObject):
text = StringField('Comment on forecast')
def __init__(self, date, low, high, text, unit):
CapBaseObject.__init__(self, unicode(date))
BaseObject.__init__(self, unicode(date))
self.date = date
self.low = Temperature(low, unit)
self.high = Temperature(high, unit)
self.text = text
class Current(CapBaseObject):
class Current(BaseObject):
"""
Current weather.
"""
@ -86,20 +86,20 @@ class Current(CapBaseObject):
temp = Field('Current temperature', Temperature)
def __init__(self, date, temp, text, unit):
CapBaseObject.__init__(self, unicode(date))
BaseObject.__init__(self, unicode(date))
self.date = date
self.text = text
self.temp = Temperature(temp, unit)
class City(CapBaseObject):
class City(BaseObject):
"""
City where to find weather.
"""
name = StringField('Name of city')
def __init__(self, id, name):
CapBaseObject.__init__(self, id)
BaseObject.__init__(self, id)
self.name = name