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
 
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
don't write or execute any files, just print notes about what we would have done to stdout
{download.Download} monitored_downloads
set 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

Parameters:
  • dry_run (bool)
Overrides: object.__init__

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.

Parameters:

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 
Parameters:

Deprecated: use tasks.wait_for_blocker instead

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