Package flumotion :: Package admin :: Package assistant :: Module interfaces
[hide private]

Source Code for Module flumotion.admin.assistant.interfaces

  1  # -*- Mode: Python -*- 
  2  # vi:si:et:sw=4:sts=4:ts=4 
  3   
  4  # Flumotion - a streaming media server 
  5  # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. 
  6  # Copyright (C) 2010,2011 Flumotion Services, S.A. 
  7  # All rights reserved. 
  8  # 
  9  # This file may be distributed and/or modified under the terms of 
 10  # the GNU Lesser General Public License version 2.1 as published by 
 11  # the Free Software Foundation. 
 12  # This file is distributed without any warranty; without even the implied 
 13  # warranty of merchantability or fitness for a particular purpose. 
 14  # See "LICENSE.LGPL" in the source distribution for more information. 
 15  # 
 16  # Headers in this file shall remain intact. 
 17   
 18  """Flumotion interfaces used by the configuration assistant 
 19  """ 
 20   
 21  from zope.interface import Interface 
 22   
 23  __version__ = "$Rev$" 
 24   
 25   
26 -class IProducerPlugin(Interface):
27 """A producer plugin is how you extend the production assistant page. 28 The main purpose of the plugin is to get a assistant step specific 29 to the plugin. 30 This entry point should be defined in the xml for the component 31 under the entry type "wizard". 32 """ 33
34 - def __call__(assistant):
35 """Creates producer plugins 36 @param assistant: the assistant 37 @type assistant: L{ConfigurationAssistant} 38 """
39
40 - def getProductionStep(type):
41 """Asks the plugin for a step. 42 type is the kind of plugin, it's useful for components such as 43 firewire for which you can point both audio and video to the 44 same plugin. 45 @param type: audio or video 46 @type type: string 47 @returns: the assistant step 48 @rtype: a L{WorkerWizardStep} subclass 49 """
50 51
52 -class IEncoderPlugin(Interface):
53 """An encoder plugin is how you extend the encoding assistant page. 54 The main purpose of the plugin is to get a assistant step specific 55 to the plugin. 56 This entry point should be defined in the xml for the component 57 under the entry type "wizard". 58 """ 59
60 - def __call__(assistant):
61 """Creates encoder plugins 62 @param assistant: the assistant 63 @type assistant: L{ConfigurationAssistant} 64 """
65
66 - def getConversionStep():
67 """Asks the plugin for a step. 68 @returns: the assistant step 69 @rtype: a L{WorkerWizardStep} subclass 70 """
71 72
73 -class IConsumerPlugin(Interface):
74 """A consumer plugin is how you extend the production assistant page. 75 The main purpose of the plugin is to get a assistant step specific 76 to the plugin. 77 This entry point should be defined in the xml for the component 78 under the entry type "wizard". 79 """ 80
81 - def __call__(assistant):
82 """Creates producer plugins 83 @param assistant: the assistant 84 @type assistant: L{ConfigurationAssistant} 85 """
86
87 - def getConsumptionStep(type):
88 """Asks the plugin for a step. 89 type is the kind of plugin. 90 @param type: audio or video or audio-video 91 @type type: string 92 @returns: the assistant step 93 @rtype: a L{WorkerWizardStep} subclass 94 """
95 96
97 -class IHTTPConsumerPlugin(Interface):
98 """A http consumer plugin is how you extend the HTTP consumer page. 99 The main purpose of the plugin is to get a consumer model 100 (eg, a http server) specific for this plugin. 101 This entry point should be defined in the xml for the component 102 under the entry type "wizard". 103 """ 104
105 - def __call__(assistant, model):
106 """Creates http consumer plugins 107 @param assistant: the assistant 108 @type assistant: L{ConfigurationAssistant} 109 """
110
111 - def workerChanged(worker):
112 """Called when the worker for the step changed. 113 @param worker: the worker 114 @type worker: L{WorkerComponentUIState} 115 """
116
117 - def getPlugWizard(description):
118 """Creates a plugin line for the consumer 119 @param description: The text to appear in the line 120 @type description: str 121 @returns: wizard plugin line 122 @rtype: a L{WizardPlugLine} 123 """
124 125
126 -class IHTTPConsumerPluginLine(Interface):
127
128 - def getConsumer(streamer, audio_producer, video_producer):
129 """Asks the plugin line for a consumer model 130 @param streamer: the http streamer 131 @type streamer: L{HTTPStreamer} subclass 132 @param audio_producer: audio producer for this stream 133 @type audio_producer: L{AudioProducer} subclass 134 @param video_producer: video producer for this stream 135 @type video_producer: L{VideoProducer} subclass 136 @returns: consumer 137 @rtype: a L{HTTPServer} subclass 138 """
139 140
141 -class IHTTPServerPlugin(Interface):
142 """A http server plugin allows to extend a HTTP server. 143 The main purpose of the plugin is to get a wizard plug line that can be 144 added into a plug area. The plugline should add/delete the plug from the 145 http server model when activated/deactivated. 146 This entry point should be defined in the xml for the plug 147 under the entry type "wizard". 148 """ 149
150 - def __call__(assistant, component):
151 """Creates http server plugins 152 @param assistant: the assistant 153 @type assistant: L{ConfigurationAssistant} 154 @param component: the component that will receive the plug 155 @type assistant: L{f.a.a.m.Component} 156 """
157
158 - def workerChanged(worker):
159 """Called when the worker for the step changed. 160 @param worker: the worker 161 @type worker: str 162 """
163
164 - def getPlugWizard(description):
165 """Creates a plugin line for the consumer 166 @param description: The text to appear in the line 167 @type description: str 168 @returns: wizard plugin line 169 @rtype: a L{WizardPlugLine} 170 """
171 172
173 -class IScenarioAssistantPlugin(Interface):
174 """A pluggable scenario that can be listed at the first page of the wizard. 175 It predefines the steps the wizard will take and the way it is saved. 176 """ 177
178 - def addSteps(assistant):
179 """Called to add the required steps to the wizard. 180 @param assistant: The assistant the steps have to be added to. 181 @type assistant: L{ConfigurationAssistant} 182 """
183
184 - def save(assistant, saver):
185 """Saves the scenario through an AdminSaver to get the configuration. 186 @param assistant: The assistant the steps have to be added to. 187 @type assistant: L{ConfigurationAssistant} 188 @param saver: The element which generates the xml configuration. 189 @type saver: L{AssistantSaver} 190 """
191