seriesmarker.net.banner_loader module

class BannerLoader[source]

Bases: PySide.QtCore.QObject

Class to load banner from the net.

__init__()[source]

Creates a new instance.

fetch_banner(url, index, cache=True)[source]

Creates a request to load a banner from the given URL.

A request is defined by its URL and carried out asynchronously. The result is stored on disk if caching is enabled. When a request has been completed, finished_request() will be invoked.

Parameters:
  • url (string) – The location of the banner to load.
  • index (QModelIndex) – The index referring to a DecoratedNode to fetch a banner for (origin of the request). Used to inform the node’s model when the request was finished.
  • cache (bool) – Determines if the loaded banner should be cached on disk.
finished_request(reply)[source]

Processes replies and dispatches results to requesters.

This method will be invoked on each finished request, submitted by fetch_banner(). It then converts the loaded data into a banner and passes the result on to the model of the request’s origin.

Parameters:reply (QNetworkReply) – The network reply from a banner load request.
staticMetaObject = <PySide.QtCore.QMetaObject object>