Package elisa :: Package plugins :: Package poblesec :: Package base :: Module list :: Class GenericListViewMode

Class GenericListViewMode

source code


Generic view mode API.

It defines a common API for clients. All one has to do is inherit from this class and implement the following methods:

Instance Methods
elisa.core.utils.cancellable_defer.CancellableDeferred
get_label(self, item)
Return a text to display in a label to represent an item.
source code
elisa.core.utils.cancellable_defer.CancellableDeferred
get_sublabel(self, item)
Return a text to display in a sublabel to represent an item.
source code
str
get_default_image(self, item)
Return the path of a theme resource to display as a default image for an item.
source code
elisa.core.utils.cancellable_defer.CancellableDeferred
get_image(self, item, theme)
Return the path to an image file to display as an image for an item.
source code
str or None
get_preview_image(self, item, theme)
Return the path to an image file to display as a preview image for an item.
source code
elisa.core.utils.cancellable_defer.CancellableDeferred
get_contextual_background(self, item)
Return the path to an image file to display as a contextual background for an item.
source code

Inherited from extern.log.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Inherited from core.component.Component
twisted.internet.defer.Deferred
clean(self)
Clean the component.
source code
twisted.internet.defer.Deferred
initialize(self, **kwargs)
Initialize the component.
source code
 
name__get(self) source code
 
name__set(self, value) source code
    Inherited from core.log.Loggable
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
Class Methods
    Inherited from core.component.Component
elisa.core.component.Component or a subclass
create(cls, config_section=None, **kwargs)
Create and initialize the component.
source code
Class Variables

Inherited from extern.log.log.Loggable: logCategory

    Inherited from core.component.Component
  config_doc = {}
  default_config = {}
  name = property(fget= name__get, fset= name__set)
  path = PathDescriptor()
Properties

Inherited from object: __class__

Method Details

get_label(self, item)

source code 

Return a text to display in a label to represent an item.

This call is asynchronous, it should return a elisa.core.utils.cancellable_defer.CancellableDeferred that, when triggered, returns the text of the label.

Parameters:
Returns: elisa.core.utils.cancellable_defer.CancellableDeferred
a cancellable deferred

get_sublabel(self, item)

source code 

Return a text to display in a sublabel to represent an item.

This call is asynchronous, it should return a elisa.core.utils.cancellable_defer.CancellableDeferred that, when triggered, returns the text of the sublabel.

Parameters:
Returns: elisa.core.utils.cancellable_defer.CancellableDeferred
a cancellable deferred

get_default_image(self, item)

source code 

Return the path of a theme resource to display as a default image for an item.

Parameters:
Returns: str
the path of a theme resource to display as a default image for the item

get_image(self, item, theme)

source code 

Return the path to an image file to display as an image for an item.

This call is asynchronous, it should return a elisa.core.utils.cancellable_defer.CancellableDeferred that, when triggered, returns the path to an image file on disk (downloaded and cached if necessary).

If no other image than the default one is necessary/available, this method should return None.

Parameters:
Returns: elisa.core.utils.cancellable_defer.CancellableDeferred
a cancellable deferred or None

get_preview_image(self, item, theme)

source code 

Return the path to an image file to display as a preview image for an item.

This call is synchronous, if no preview image is available yet for the item or if no other image than the default one is necessary, it should return None.

Parameters:
Returns: str or None
the path to an image file on disk or None

get_contextual_background(self, item)

source code 

Return the path to an image file to display as a contextual background for an item.

This call is asynchronous, it should return a elisa.core.utils.cancellable_defer.CancellableDeferred that, when triggered, returns the path to an image file on disk (downloaded and cached if necessary) or None if not availadble.

Parameters:
Returns: elisa.core.utils.cancellable_defer.CancellableDeferred
a cancellable deferred