Package flumotion :: Package admin :: Package gtk :: Module configurationassistant :: Class ConfigurationAssistant
[hide private]

Class ConfigurationAssistant

source code

        gobject.GObject --+                        
                          |                        
    kiwi.ui.views.SlaveView --+                    
                              |                    
         kiwi.ui.views.BaseView --+                
                                  |                
kiwi.controllers.BaseController --+                
                                  |                
    kiwi.ui.delegates.GladeDelegate --+            
                                      |            
                   ui.glade.GladeBacked --+        
                                          |        
                       ui.glade.GladeWindow --+    
                                              |    
                    extern.log.log.Loggable --+    
                                              |    
                        ui.wizard.SectionWizard --+
                                                  |
                                                 ConfigurationAssistant

This is the main configuration assistant class,
it is responsible for::
- executing tasks which will block the ui
- showing a worker list in the UI
- communicating with the manager, fetching bundles
  and registry information
- running check defined by a step in a worker, for instance
  querying for hardware devices and their capabilities
It extends SectionWizard which provides the basic user interface, such
as sidebar, buttons, title bar and basic step navigation.

Instance Methods [hide private]
 
__init__(self, parent=None)
Creates a new GladeDelegate.
source code
 
completed(self) source code
 
destroy(self) source code
 
beforeShowStep(self, step) source code
 
prepareNextStep(self, step) source code
 
blockNext(self, block) source code
 
addInitialSteps(self)
Add the step sections of the wizard, can be overridden in a subclass
source code
 
setScenario(self, scenario)
Sets the current scenario of the assistant.
source code
a flumotion.admin.assistant.scenarios.Scenario subclass
getScenario(self)
Fetches the currently set scenario of the assistant.
source code
 
setWorkerHeavenState(self, workerHeavenState)
Sets the worker heaven state of the assistant
source code
 
setAdminModel(self, adminModel)
Sets the admin model of the assistant
source code
 
setHTTPPorters(self, porters)
Sets the list of currently configured porters so we can reuse them for future streamers.
source code
 
getHTTPPorters(self)
Obtains the list of the currently configured porters.
source code
 
addMountPoint(self, worker, port, mount_point, consumer=None)
Marks a mount point as used on the given worker and port.
source code
 
getAdminModel(self)
Gets the admin model of the assistant
source code
 
waitForTask(self, taskName)
Instruct the assistant that we're waiting for a task to be finished.
source code
 
taskFinished(self, blockNext=False)
Instruct the assistant that a task was finished.
source code
bool
pendingTask(self)
Returns true if there are any pending tasks
source code
twisted.internet.defer.Deferred
checkElements(self, workerName, *elementNames)
Check if the given list of GStreamer elements exist on the given worker.
source code
deferred -> list of strings
requireElements(self, workerName, *elementNames)
Require that the given list of GStreamer elements exists on the given worker.
source code
twisted.internet.defer.Deferred
checkImport(self, workerName, moduleName)
Check if the given module can be imported.
source code
twisted.internet.defer.Deferred
requireImport(self, workerName, moduleName, projectName=None, projectURL=None)
Require that the given module can be imported on the given worker.
source code
twisted.internet.defer.Deferred
runInWorker(self, workerName, moduleName, functionName, *args, **kwargs)
Run the given function and arguments on the selected worker.
source code
twisted.internet.defer.Deferred
getWizardEntry(self, componentType)
Fetches a assistant bundle from a specific kind of component
source code
twisted.internet.defer.Deferred
getWizardScenario(self, scenarioType)
Fetches a scenario bundle from a specific kind of component.
source code
twisted.internet.defer.Deferred
getWizardPlugEntry(self, plugType)
Fetches a assistant bundle from a specific kind of plug
source code
twisted.internet.defer.Deferred
getWizardEntries(self, wizardTypes=None, provides=None, accepts=None)
Queries the manager for a list of assistant entries matching the query.
source code
 
setExistingComponentNames(self, componentNames)
Tells the assistant about the existing components available, so we can resolve naming conflicts when saving the configuration
source code
 
workerChangedForStep(self, step, workerName)
Tell a step that its worker changed.
source code
 
_gotEntryPoint(self, (filename, procname)) source code
 
_setupWorker(self, step, worker) source code
 
_showHelpLink(self, section, anchor, docVersion) source code
 
_fetchDescription(self, step) source code
 
on_combobox_worker_changed(self, combobox, worker) source code
 
_on_assistant__help_clicked(self, assistant, section, anchor, version) source code
 
on_admin_connected_cb(self, admin) source code
 
on_admin_disconnected_cb(self, admin) source code

Inherited from ui.wizard.SectionWizard: __len__, __nonzero__, addStepSection, add_msg, cleanFutureSteps, clear_all_msg, clear_msg, finish, getCurrentStep, getStep, getSteps, getVisitedSteps, goNext, hasStep, hide, on_button_help_clicked, on_button_next_clicked, on_button_prev_clicked, on_sidebar_step_chosen, on_window_delete_event, on_window_destroy, on_window_realize, packStep, run, setStepDescription, updateButtons

Inherited from ui.wizard.SectionWizard (private): _helpClicked, _setStepIcon, _setStepTitle

Inherited from kiwi.ui.views.BaseView: check_focus, get_focus_widget, get_glade_adaptor, hide_and_quit, quit_if_last, set_title, set_transient_for, show, show_all

Inherited from kiwi.ui.views.BaseView (private): _attach_callbacks, _setup_keypress_handler

Inherited from kiwi.ui.views.SlaveView: add_proxy, attach_slave, check_and_notify_validity, connect_multiple, detach_slave, disconnect_autoconnected, enable_window_controls, focus_toplevel, focus_topmost, force_validation, get_sizegroups, get_slave, get_toplevel, get_topmost_widget, get_widget, handler_block, handler_unblock, on_attach, on_startup, register_validate_function, set_controller, show_and_loop

Inherited from kiwi.ui.views.SlaveView (private): _attach_groups, _check_reserved, _get_notebooks, _get_toplevel, _merge_sizegroup, _on_child__validation_changed, _on_notebook_slave__validation_changed

Inherited from kiwi.controllers.BaseController: get_parent, get_view, on_key_press, set_keyactions, set_parent, set_view, update_keyactions

Inherited from kiwi.controllers.BaseController (private): _get_all_methods

Inherited from extern.log.log.Loggable: __providedBy__, __provides__, debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure, writeMarker

Class Variables [hide private]

Inherited from ui.wizard.SectionWizard: gladeFile, logCategory

Inherited from ui.glade.GladeBacked: toplevel_name

Inherited from ui.glade.GladeBacked (private): _window

Inherited from kiwi.ui.views.SlaveView: controller, domain, gladefile, toplevel

Inherited from kiwi.controllers.BaseController: view

Inherited from extern.log.log.Loggable: __implemented__

Instance Variables [hide private]

Inherited from ui.glade.GladeWindow: window

Inherited from ui.glade.GladeBacked: gladeTypedict, widgets

Method Details [hide private]

__init__(self, parent=None)
(Constructor)

source code 

Creates a new GladeDelegate. The keyactions parameter is sent to kiwi.controllers.BaseController, the rest are sent to kiwi.ui.views.BaseView

Overrides: kiwi.controllers.BaseController.__init__
(inherited documentation)

completed(self)

source code 
Overrides: ui.wizard.SectionWizard.completed

destroy(self)

source code 
Overrides: ui.glade.GladeWindow.destroy

beforeShowStep(self, step)

source code 
Overrides: ui.wizard.SectionWizard.beforeShowStep

blockNext(self, block)

source code 
Overrides: ui.wizard.SectionWizard.blockNext

setScenario(self, scenario)

source code 

Sets the current scenario of the assistant. Normally called by ScenarioStep to tell the assistant the current scenario just after creating it.

Parameters:
  • scenario (a flumotion.admin.assistant.scenarios.Scenario subclass) - the scenario of the assistant

setWorkerHeavenState(self, workerHeavenState)

source code 

Sets the worker heaven state of the assistant

Parameters:

setAdminModel(self, adminModel)

source code 

Sets the admin model of the assistant

Parameters:

setHTTPPorters(self, porters)

source code 

Sets the list of currently configured porters so we can reuse them for future streamers.

Parameters:

getHTTPPorters(self)

source code 

Obtains the list of the currently configured porters.

@rtype : list of flumotion.admin.assistant.models.Porter

addMountPoint(self, worker, port, mount_point, consumer=None)

source code 

Marks a mount point as used on the given worker and port.
If a consumer name is provided it means we are changing the
mount point for that consumer and that we should keep track of
it for further modifications.

@param worker   : The worker where the mount_point is configured.
@type  worker   : str
@param port     : The port where the streamer should be listening.
@type  port     : int
@param mount_point : The mount point where the data will be served.
@type  mount_point : str
@param consumer : The consumer that is changing its mountpoint.
@type  consumer : str

@returns : True if the mount point is not used and has been
           inserted correctly, False otherwise.
@rtype   : boolean

waitForTask(self, taskName)

source code 

Instruct the assistant that we're waiting for a task to be finished. This changes the cursor and prevents the user from continuing moving forward. Each call to this method should have another call to taskFinished() when the task is actually done.

Parameters:
  • taskName (string) - name of the name

taskFinished(self, blockNext=False)

source code 

Instruct the assistant that a task was finished.

Parameters:
  • blockNext (boolean) - if we should still next when done

pendingTask(self)

source code 

Returns true if there are any pending tasks

Returns: bool
if there are pending tasks

checkElements(self, workerName, *elementNames)

source code 

Check if the given list of GStreamer elements exist on the given worker.

Parameters:
  • workerName (string) - name of the worker to check on
  • elementNames (list of strings) - names of the elements to check
Returns: twisted.internet.defer.Deferred
a deferred returning a tuple of the missing elements

requireElements(self, workerName, *elementNames)

source code 

Require that the given list of GStreamer elements exists on the given worker. If the elements do not exist, an error message is posted and the next button remains blocked.

Parameters:
  • workerName (string) - name of the worker to check on
  • elementNames (list of strings) - names of the elements to check
Returns: deferred -> list of strings
element name

checkImport(self, workerName, moduleName)

source code 

Check if the given module can be imported.

Parameters:
  • workerName (string) - name of the worker to check on
  • moduleName (string) - name of the module to import
Returns: twisted.internet.defer.Deferred
a deferred firing None or Failure.

requireImport(self, workerName, moduleName, projectName=None, projectURL=None)

source code 

Require that the given module can be imported on the given worker. If the module cannot be imported, an error message is posted and the next button remains blocked.

Parameters:
  • workerName (string) - name of the worker to check on
  • moduleName (string) - name of the module to import
  • projectName (string) - name of the module to import
  • projectURL (string) - URL of the project
Returns: twisted.internet.defer.Deferred
a deferred firing None or Failure

runInWorker(self, workerName, moduleName, functionName, *args, **kwargs)

source code 

Run the given function and arguments on the selected worker. The given function should return a messages.Result.

Parameters:
  • workerName (string) - name of the worker to run the function in
  • moduleName (string) - name of the module where the function is found
  • functionName (string) - name of the function to run
Returns: twisted.internet.defer.Deferred
a deferred firing the Result's value.

getWizardEntry(self, componentType)

source code 

Fetches a assistant bundle from a specific kind of component

Parameters:
  • componentType (string) - the component type to get the assistant entry bundle from.
Returns: twisted.internet.defer.Deferred
a deferred returning either:
 - factory of the component
 - noBundle error: if the component lacks a assistant bundle

getWizardScenario(self, scenarioType)

source code 

Fetches a scenario bundle from a specific kind of component.

Parameters:
  • scenarioType (string) - the scenario type to get the assistant entry bundle from.
Returns: twisted.internet.defer.Deferred
a deferred returning either:
 - factory of the component
 - noBundle error: if the component lacks a assistant bundle

getWizardPlugEntry(self, plugType)

source code 

Fetches a assistant bundle from a specific kind of plug

Parameters:
  • plugType (string) - the plug type to get the assistant entry bundle from.
Returns: twisted.internet.defer.Deferred
a deferred returning either:
 - factory of the plug
 - noBundle error: if the plug lacks a assistant bundle

getWizardEntries(self, wizardTypes=None, provides=None, accepts=None)

source code 

Queries the manager for a list of assistant entries matching the query.

Parameters:
  • wizardTypes (list of str) - list of component types to fetch, is usually something like ['video-producer'] or ['audio-encoder']
  • provides (list of str) - formats provided, eg ['jpeg', 'speex']
  • accepts (list of str) - formats accepted, eg ['theora']
Returns: twisted.internet.defer.Deferred
a deferred firing a list of flumotion.common.componentui.WizardEntryState

setExistingComponentNames(self, componentNames)

source code 

Tells the assistant about the existing components available, so we can resolve naming conflicts when saving the configuration

Parameters:
  • componentNames (list of strings) - existing component names

workerChangedForStep(self, step, workerName)

source code 

Tell a step that its worker changed.

Parameters:
  • step (a WorkerWizardStep subclass) - step which worker changed for
  • workerName (string) - name of the worker