Package zeroinstall :: Package injector :: Module handler :: Class Handler
[frames] | no frames]

Class Handler

source code

object --+
         |
        Handler

This implementation uses the GLib mainloop. Note that QT4 can use the GLib mainloop too.

Instance Methods
 
__init__(self, mainloop=None, dry_run=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
monitor_download(self, dl)
Called when a new download is started.
source code
 
impl_added_to_store(self, impl)
Called by the fetch.Fetcher when adding an implementation.
source code
 
downloads_changed(self)
This is just for the GUI to override to update its display.
source code
 
wait_for_blocker(self, blocker)
Run a recursive mainloop until blocker is triggered.
source code
download.Download
get_download(self, url, force=False, hint=None)
Return the Download object currently downloading 'url'.
source code
tasks.Blocker
confirm_trust_keys(self, interface, sigs, iface_xml)
We don't trust any of the signatures yet.
source code
 
report_error(self, exception, tb=None)
Report an exception to the user.
source code

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

Instance Variables
{URL: download.Download} monitored_downloads
dict of downloads in progress
int n_completed_downloads
number of downloads which have finished for GUIs, etc (can be reset as desired).
int total_bytes_downloaded
informational counter for GUIs, etc (can be reset as desired).
Properties

Inherited from object: __class__

Method Details

__init__(self, mainloop=None, dry_run=False)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

monitor_download(self, dl)

source code 

Called when a new download is started. This is mainly used by the GUI to display the progress bar.

impl_added_to_store(self, impl)

source code 

Called by the fetch.Fetcher when adding an implementation. The GUI uses this to update its display.

Parameters:

wait_for_blocker(self, blocker)

source code 

Run a recursive mainloop until blocker is triggered.

Parameters:

get_download(self, url, force=False, hint=None)

source code 

Return the Download object currently downloading 'url'. If no download for this URL has been started, start one now (and start monitoring it). If the download failed and force is False, return it anyway. If force is True, abort any current or failed download and start a new one.

Returns: download.Download

confirm_trust_keys(self, interface, sigs, iface_xml)

source code 

We don't trust any of the signatures yet. Ask the user. When done update the trust database, and then call trust.TrustDB.notify.

Parameters:
  • interface - the interface being updated
  • sigs - a list of signatures (from gpg.check_stream)
  • iface_xml - the downloaded data (not yet trusted)
Returns: tasks.Blocker
a blocker, if confirmation will happen asynchronously, or None

report_error(self, exception, tb=None)

source code 

Report an exception to the user.

Parameters:
  • exception (SafeException) - the exception to report
  • tb - optional traceback

Since: 0.25


Instance Variable Details

total_bytes_downloaded

informational counter for GUIs, etc (can be reset as desired). Updated when download finishes.
Type:
int