rename CapBaseObject to BaseObject (refs #1424)
This commit is contained in:
parent
4529735935
commit
51958135cb
44 changed files with 183 additions and 183 deletions
|
|
@ -28,7 +28,7 @@ import sys
|
|||
import tempfile
|
||||
import warnings
|
||||
|
||||
from weboob.capabilities.base import ConversionWarning, CapBaseObject
|
||||
from weboob.capabilities.base import ConversionWarning, BaseObject
|
||||
from weboob.core import Weboob, CallErrors
|
||||
from weboob.core.backendscfg import BackendsConfig
|
||||
from weboob.tools.config.iconfig import ConfigError
|
||||
|
|
@ -251,7 +251,7 @@ class BaseApplication(object):
|
|||
def _do_complete_obj(self, backend, fields, obj):
|
||||
if not obj:
|
||||
return obj
|
||||
if not isinstance(obj, CapBaseObject):
|
||||
if not isinstance(obj, BaseObject):
|
||||
return obj
|
||||
|
||||
obj.backend = backend.name
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ else:
|
|||
finally:
|
||||
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
|
||||
|
||||
from weboob.capabilities.base import CapBaseObject
|
||||
from weboob.capabilities.base import BaseObject
|
||||
from weboob.tools.application.console import ConsoleApplication
|
||||
from weboob.tools.ordereddict import OrderedDict
|
||||
|
||||
|
|
@ -139,13 +139,13 @@ class IFormatter(object):
|
|||
An object has fields which can be selected.
|
||||
|
||||
:param obj: object to format
|
||||
:type obj: CapBaseObject or dict
|
||||
:type obj: BaseObject or dict
|
||||
:param selected_fields: fields to display. If None, all fields are selected
|
||||
:type selected_fields: tuple
|
||||
:param alias: an alias to use instead of the object's ID
|
||||
:type alias: unicode
|
||||
"""
|
||||
if isinstance(obj, CapBaseObject):
|
||||
if isinstance(obj, BaseObject):
|
||||
if selected_fields: # can be an empty list (nothing to do), or None (return all fields)
|
||||
obj = obj.copy()
|
||||
for name, value in obj.iter_fields():
|
||||
|
|
@ -162,7 +162,7 @@ class IFormatter(object):
|
|||
try:
|
||||
obj = OrderedDict(obj)
|
||||
except ValueError:
|
||||
raise TypeError('Please give a CapBaseObject or a dict')
|
||||
raise TypeError('Please give a BaseObject or a dict')
|
||||
|
||||
if selected_fields:
|
||||
obj = obj.copy()
|
||||
|
|
@ -188,7 +188,7 @@ class IFormatter(object):
|
|||
This method has to be overridden in child classes.
|
||||
|
||||
:param obj: object to format
|
||||
:type obj: CapBaseObject
|
||||
:type obj: BaseObject
|
||||
:rtype: str
|
||||
"""
|
||||
return self.format_dict(obj.to_dict())
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ from optparse import OptionGroup, OptionParser, IndentedHelpFormatter
|
|||
import os
|
||||
import sys
|
||||
|
||||
from weboob.capabilities.base import FieldNotFound, CapBaseObject, UserError
|
||||
from weboob.capabilities.base import FieldNotFound, BaseObject, UserError
|
||||
from weboob.core import CallErrors
|
||||
from weboob.tools.application.formatters.iformatter import MandatoryFieldsNotFound
|
||||
from weboob.tools.misc import to_unicode
|
||||
|
|
@ -192,7 +192,7 @@ class ReplApplication(Cmd, ConsoleApplication):
|
|||
except (IndexError, ValueError):
|
||||
pass
|
||||
else:
|
||||
if isinstance(obj, CapBaseObject):
|
||||
if isinstance(obj, BaseObject):
|
||||
id = obj.fullid
|
||||
try:
|
||||
return ConsoleApplication.parse_id(self, id, unique_backend)
|
||||
|
|
@ -1147,7 +1147,7 @@ class ReplApplication(Cmd, ConsoleApplication):
|
|||
the object.
|
||||
|
||||
:param obj: object
|
||||
:type obj: CapBaseObject
|
||||
:type obj: BaseObject
|
||||
:param dest: dest given by user (default None)
|
||||
:type dest: str
|
||||
:param default: default file mask (if not given, this is '{id}-{title}.{ext}')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue