Package zeroinstall :: Module helpers
[frames] | no frames]

Module helpers

source code

Convenience routines for performing common operations.


Since: 0.28

Functions
zeroinstall.injector.selections.Selections
get_selections_gui(iface_uri, gui_args, test_callback=None, use_gui=True)
Run the GUI to choose and download a set of implementations.
source code
zeroinstall.injector.selections.Selections
ensure_cached(uri, command='run', config=None)
Ensure that an implementation of uri is cached.
source code
 
exec_man(stores, sels, main=None, fallback_name=None)
Exec the man command to show the man-page for this interface.
source code
Variables
  DontUseGUI = object()
Function Details

get_selections_gui(iface_uri, gui_args, test_callback=None, use_gui=True)

source code 

Run the GUI to choose and download a set of implementations. The user may ask the GUI to submit a bug report about the program. In that case, the GUI may ask us to test it. test_callback is called in that case with the implementations to be tested; the callback will typically call zeroinstall.injector.run.test_selections and return the result of that.

Parameters:
  • iface_uri (str) - the required program, or None to show just the preferences dialog
  • gui_args ([str]) - any additional arguments for the GUI itself
  • test_callback (zeroinstall.injector.selections.Selections -> str) - function to use to try running the program
  • use_gui (bool | None) - if True, raise a SafeException if the GUI is not available. If None, returns DontUseGUI if the GUI cannot be started. If False, returns DontUseGUI always. (since 1.11)
Returns: zeroinstall.injector.selections.Selections
the selected implementations

Since: 0.28

ensure_cached(uri, command='run', config=None)

source code 

Ensure that an implementation of uri is cached. If not, it downloads one. It uses the GUI if a display is available, or the console otherwise.

Parameters:
  • uri (str) - the required interface
  • command (str)
Returns: zeroinstall.injector.selections.Selections
the selected implementations, or None if the user cancelled

exec_man(stores, sels, main=None, fallback_name=None)

source code 

Exec the man command to show the man-page for this interface. Never returns.

Parameters:

Since: 1.12