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

Class Handler

source code

object --+
         |
        Handler

A Handler is used to interact with the user (e.g. to confirm keys, display download progress, etc).

Instance Methods
 
__init__(self, mainloop=None, dry_run=False)
x.__init__(...) initializes x; see help(type(x)) 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) source code
download.Download
get_download(self, url, force=False, hint=None, factory=None)
Return the Download object currently downloading 'url'.
source code
 
confirm_import_feed(self, pending, valid_sigs)
Sub-classes should override this method to interact with the user about new feeds.
source code
 
confirm_install(self, msg)
We need to check something with the user before continuing with the install.
source code
 
report_error(self, exception, tb=None)
Report an exception to the user.
source code

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

Instance Variables
bool dry_run
instead of starting a download, just report what we would have downloaded
{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 help(type(x)) 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 

Deprecated: use tasks.wait_for_blocker instead

get_download(self, url, force=False, hint=None, factory=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_import_feed(self, pending, valid_sigs)

source code 

Sub-classes should override this method to interact with the user about new feeds. If multiple feeds need confirmation, trust.TrustMgr.confirm_keys will only invoke one instance of this method at a time.

Parameters:
Decorators:
  • @tasks.async

Since: 0.42

confirm_install(self, msg)

source code 

We need to check something with the user before continuing with the install.

Decorators:
  • @tasks.async
Raises:

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