dip.shell.tools.model_manager

This module contains the default implementation of a tool that handles the lifecycle of managed models in a shell.

ModelManagerTool

class dip.shell.tools.model_manager.ModelManagerTool

Base class: Model

The ModelManagerTool class is a tool that handles the lifecycle of managed models in a shell.

choose_model_wizard_title = Str('Choose an item')

The title of the wizard page to choose a model.

choose_new_model_prompt = Str('From the list below choose what sort of item you want to create.n')

The text to use to prompt the user to choose a new model. FIXME: The newlines are needed for OS/X (don’t know about other FIXME: platforms). Should it be moved to the toolkit implementation?

choose_open_model_prompt = Str('From the list below choose what sort of item you want to open.n')

The text to use to prompt the user to choose a model to open.

choose_tool_prompt = Str('From the list below choose what tool you want to use.n')

The text to use to prompt the user to choose a tool.

choose_tool_wizard_title = Str('Choose a tool')

The title of the wizard page to choose a tool.

close_action = CloseAction()

The Close action.

id = 'dip.shell.tools.model_manager'

The tool’s identifier.

new_action = NewAction()

The New action.

open_action = OpenAction()

The Open action.

save_action = SaveAction()

The Save action.

save_as_action = SaveAsAction()

The Save As action.

user_close_question = Str('Do you still want to close?')

The text used as the question asking if the user really wants to close.

user_close_title = Str()

The text used as the title of the “Close” related views.

user_new_title = Str()

The text used as the title of the “New” related views.

user_open_title = Str()

The text used as the title of the “Open” related views.

user_save_title = Str()

The text used as the title of the “Save” related views.

user_save_as_title = Str()

The text used as the title of the “Save As” related views.

__init__()

Initialise the tool.

open_model(location, tool)

This handles open_model() on behalf of an implementation of the IManagedModelTool interface.

Parameters:
  • location – is the storage location.
  • tool – is the tool.
veto_close_view(view, tool)

This handles veto() on behalf of an implementation of the IManagedModelTool interface.

Parameters:
  • view – is the view.
  • tool – is the tool.
Returns:

True if the close of the view is to be prevented.