r6244 - in flumotion/trunk: . flumotion/component/consumers/httpstreamer flumotion/component/misc/cortado flumotion/wizard flumotion/worker/checks

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Fri Feb 15 20:12:28 CET 2008


Author: jdahlin
Date: Fri Feb 15 20:12:25 2008
New Revision: 6244

Log:
2008-02-15  Johan Dahlin  <johan at gnome.org>

    * configure.ac:
    * flumotion/component/consumers/httpstreamer/http-wizard.glade:
    * flumotion/component/consumers/httpstreamer/http_wizard.py:
    * flumotion/component/misc/cortado/Makefile.am:
    * flumotion/component/misc/cortado/cortado.py:
    * flumotion/component/misc/cortado/cortado.xml:
    * flumotion/component/misc/cortado/cortado_location.py.in:
    * flumotion/component/misc/cortado/cortado_wizard.py:
    * flumotion/wizard/configurationwizard.py:
    * flumotion/wizard/conversionsteps.py:
    * flumotion/wizard/models.py:
    * flumotion/wizard/save.py:
    * flumotion/worker/checks/Makefile.am:
    * flumotion/worker/checks/package.xml:
    * flumotion/worker/checks/cortado.py
    Make the http consumption step pluggable.
    Make the cortado presence detectable in runtime instead of at 
    configure time.
    Migrate the cortado step to be a pluggable plug.
    Fixes #823



Added:
   flumotion/trunk/flumotion/component/misc/cortado/cortado_wizard.py
      - copied unchanged from r6240, /flumotion/branches/wizard-pluggable-http-consumers/flumotion/component/misc/cortado/cortado_wizard.py
   flumotion/trunk/flumotion/worker/checks/cortado.py
      - copied unchanged from r6240, /flumotion/branches/wizard-pluggable-http-consumers/flumotion/worker/checks/cortado.py
Modified:
   flumotion/trunk/   (props changed)
   flumotion/trunk/ChangeLog
   flumotion/trunk/configure.ac
   flumotion/trunk/flumotion/component/consumers/httpstreamer/http-wizard.glade
   flumotion/trunk/flumotion/component/consumers/httpstreamer/http_wizard.py
   flumotion/trunk/flumotion/component/misc/cortado/Makefile.am
   flumotion/trunk/flumotion/component/misc/cortado/cortado.py
   flumotion/trunk/flumotion/component/misc/cortado/cortado.xml
   flumotion/trunk/flumotion/component/misc/cortado/cortado_location.py.in
   flumotion/trunk/flumotion/wizard/configurationwizard.py
   flumotion/trunk/flumotion/wizard/conversionsteps.py
   flumotion/trunk/flumotion/wizard/models.py
   flumotion/trunk/flumotion/wizard/save.py
   flumotion/trunk/flumotion/worker/checks/Makefile.am
   flumotion/trunk/flumotion/worker/checks/package.xml

Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Fri Feb 15 20:12:25 2008
@@ -1,4 +1,27 @@
-2008-02-15  Johan Dahlin  <jdahlin at gnome.org>
+2008-02-15  Johan Dahlin  <johan at gnome.org>
+
+	* configure.ac:
+	* flumotion/component/consumers/httpstreamer/http-wizard.glade:
+	* flumotion/component/consumers/httpstreamer/http_wizard.py:
+	* flumotion/component/misc/cortado/Makefile.am:
+	* flumotion/component/misc/cortado/cortado.py:
+	* flumotion/component/misc/cortado/cortado.xml:
+	* flumotion/component/misc/cortado/cortado_location.py.in:
+	* flumotion/component/misc/cortado/cortado_wizard.py:
+	* flumotion/wizard/configurationwizard.py:
+	* flumotion/wizard/conversionsteps.py:
+	* flumotion/wizard/models.py:
+	* flumotion/wizard/save.py:
+	* flumotion/worker/checks/Makefile.am:
+	* flumotion/worker/checks/package.xml:
+	* flumotion/worker/checks/cortado.py
+	Make the http consumption step pluggable.
+	Make the cortado presence detectable in runtime instead of at 
+	configure time.
+	Migrate the cortado step to be a pluggable plug.
+	Fixes #823
+
+2008-02-15  Johan Dahlin  <johan at gnome.org>
 
 	reviewed by: Mike
 

Modified: flumotion/trunk/configure.ac
==============================================================================
--- flumotion/trunk/configure.ac	(original)
+++ flumotion/trunk/configure.ac	Fri Feb 15 20:12:25 2008
@@ -159,24 +159,11 @@
 TWISTED_MODULE([twisted.web])
 
 dnl Cortado
-AC_SUBST(CORTADO_FILENAME)
 AC_ARG_WITH(cortado_prefix,
            AC_HELP_STRING(--with-cortado-prefix=<dir>, where cortado can be found))
 
-AC_MSG_CHECKING(for cortado)
-RESULT="no"
-CORTADO_FILENAME=""
-for dir in $with_cortado_prefix /usr/local /usr; do
-    for version in 0.2.2 0.2.1 0.2.0; do
-	filename=$dir/share/cortado/cortado-ovt-stripped-$version.1.jar
-        if test -e "$filename"; then
-	     RESULT="found"
-             CORTADO_FILENAME="$filename"
- 	     break 2;
-        fi
-    done
-done
-AC_MSG_RESULT($RESULT)
+CORTADO_PREFIX="$with_cortado_prefix"
+AC_SUBST(CORTADO_PREFIX)
 
 AC_CONFIG_FILES([env], [chmod +x env])
 AC_CONFIG_FILES([bin/flumotion], [chmod +x bin/flumotion])

Modified: flumotion/trunk/flumotion/component/consumers/httpstreamer/http-wizard.glade
==============================================================================
--- flumotion/trunk/flumotion/component/consumers/httpstreamer/http-wizard.glade	(original)
+++ flumotion/trunk/flumotion/component/consumers/httpstreamer/http-wizard.glade	Fri Feb 15 20:12:25 2008
@@ -19,403 +19,413 @@
   <property name="urgency_hint">False</property>
 
   <child>
-    <widget class="GtkTable" id="table2">
+    <widget class="GtkVBox" id="main_vbox">
       <property name="visible">True</property>
-      <property name="n_rows">6</property>
-      <property name="n_columns">3</property>
       <property name="homogeneous">False</property>
-      <property name="row_spacing">6</property>
-      <property name="column_spacing">6</property>
-
-      <child>
-	<widget class="GtkLabel" id="label1">
-	  <property name="visible">True</property>
-	  <property name="label" translatable="yes">_Port:</property>
-	  <property name="use_underline">True</property>
-	  <property name="use_markup">False</property>
-	  <property name="justify">GTK_JUSTIFY_LEFT</property>
-	  <property name="wrap">False</property>
-	  <property name="selectable">False</property>
-	  <property name="xalign">1</property>
-	  <property name="yalign">0.5</property>
-	  <property name="xpad">0</property>
-	  <property name="ypad">0</property>
-	  <property name="mnemonic_widget">port</property>
-	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-	  <property name="width_chars">-1</property>
-	  <property name="single_line_mode">False</property>
-	  <property name="angle">0</property>
-	</widget>
-	<packing>
-	  <property name="left_attach">0</property>
-	  <property name="right_attach">1</property>
-	  <property name="top_attach">0</property>
-	  <property name="bottom_attach">1</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options"></property>
-	</packing>
-      </child>
-
-      <child>
-	<widget class="GtkLabel" id="label7">
-	  <property name="visible">True</property>
-	  <property name="label" translatable="yes">Mbit/s</property>
-	  <property name="use_underline">False</property>
-	  <property name="use_markup">False</property>
-	  <property name="justify">GTK_JUSTIFY_LEFT</property>
-	  <property name="wrap">False</property>
-	  <property name="selectable">False</property>
-	  <property name="xalign">0</property>
-	  <property name="yalign">0.5</property>
-	  <property name="xpad">0</property>
-	  <property name="ypad">0</property>
-	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-	  <property name="width_chars">-1</property>
-	  <property name="single_line_mode">False</property>
-	  <property name="angle">0</property>
-	</widget>
-	<packing>
-	  <property name="left_attach">2</property>
-	  <property name="right_attach">3</property>
-	  <property name="top_attach">3</property>
-	  <property name="bottom_attach">4</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options"></property>
-	</packing>
-      </child>
-
-      <child>
-	<widget class="GtkLabel" id="label6">
-	  <property name="visible">True</property>
-	  <property name="label" translatable="yes">clients</property>
-	  <property name="use_underline">False</property>
-	  <property name="use_markup">False</property>
-	  <property name="justify">GTK_JUSTIFY_LEFT</property>
-	  <property name="wrap">False</property>
-	  <property name="selectable">False</property>
-	  <property name="xalign">0</property>
-	  <property name="yalign">0.5</property>
-	  <property name="xpad">0</property>
-	  <property name="ypad">0</property>
-	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-	  <property name="width_chars">-1</property>
-	  <property name="single_line_mode">False</property>
-	  <property name="angle">0</property>
-	</widget>
-	<packing>
-	  <property name="left_attach">2</property>
-	  <property name="right_attach">3</property>
-	  <property name="top_attach">2</property>
-	  <property name="bottom_attach">3</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options"></property>
-	</packing>
-      </child>
-
-      <child>
-	<widget class="GtkLabel" id="label4">
-	  <property name="visible">True</property>
-	  <property name="label" translatable="yes">_Mount point:</property>
-	  <property name="use_underline">True</property>
-	  <property name="use_markup">False</property>
-	  <property name="justify">GTK_JUSTIFY_LEFT</property>
-	  <property name="wrap">False</property>
-	  <property name="selectable">False</property>
-	  <property name="xalign">1</property>
-	  <property name="yalign">0.5</property>
-	  <property name="xpad">0</property>
-	  <property name="ypad">0</property>
-	  <property name="mnemonic_widget">mount_point</property>
-	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-	  <property name="width_chars">-1</property>
-	  <property name="single_line_mode">False</property>
-	  <property name="angle">0</property>
-	</widget>
-	<packing>
-	  <property name="left_attach">0</property>
-	  <property name="right_attach">1</property>
-	  <property name="top_attach">1</property>
-	  <property name="bottom_attach">2</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options"></property>
-	</packing>
-      </child>
+      <property name="spacing">0</property>
 
       <child>
 	<widget class="GtkAlignment" id="alignment1">
 	  <property name="visible">True</property>
-	  <property name="xalign">1</property>
-	  <property name="yalign">0.5</property>
-	  <property name="xscale">0</property>
-	  <property name="yscale">1</property>
-	  <property name="top_padding">0</property>
-	  <property name="bottom_padding">0</property>
-	  <property name="left_padding">0</property>
-	  <property name="right_padding">0</property>
-
-	  <child>
-	    <widget class="GtkCheckButton" id="has_client_limit">
-	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="label" translatable="yes">User limit:</property>
-	      <property name="use_underline">True</property>
-	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
-	      <property name="active">True</property>
-	      <property name="inconsistent">False</property>
-	      <property name="draw_indicator">True</property>
-	      <signal name="toggled" handler="on_has_client_limit_toggled" last_modification_time="Tue, 12 Jun 2007 14:56:59 GMT"/>
-	    </widget>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="left_attach">0</property>
-	  <property name="right_attach">1</property>
-	  <property name="top_attach">2</property>
-	  <property name="bottom_attach">3</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options">fill</property>
-	</packing>
-      </child>
-
-      <child>
-	<widget class="GtkAlignment" id="alignment2">
-	  <property name="visible">True</property>
-	  <property name="xalign">0</property>
-	  <property name="yalign">0.5</property>
-	  <property name="xscale">0</property>
-	  <property name="yscale">1</property>
-	  <property name="top_padding">0</property>
-	  <property name="bottom_padding">0</property>
-	  <property name="left_padding">0</property>
-	  <property name="right_padding">0</property>
-
-	  <child>
-	    <widget class="GtkCheckButton" id="has_bandwidth_limit">
-	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="label" translatable="yes">Bandwidth limit:</property>
-	      <property name="use_underline">True</property>
-	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
-	      <property name="active">False</property>
-	      <property name="inconsistent">False</property>
-	      <property name="draw_indicator">True</property>
-	      <signal name="toggled" handler="on_has_bandwidth_limit_toggled" last_modification_time="Tue, 12 Jun 2007 14:57:04 GMT"/>
-	    </widget>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="left_attach">0</property>
-	  <property name="right_attach">1</property>
-	  <property name="top_attach">3</property>
-	  <property name="bottom_attach">4</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options">fill</property>
-	</packing>
-      </child>
-
-      <child>
-	<widget class="GtkAlignment" id="alignment3">
-	  <property name="visible">True</property>
-	  <property name="xalign">0</property>
-	  <property name="yalign">0.5</property>
-	  <property name="xscale">0</property>
-	  <property name="yscale">1</property>
-	  <property name="top_padding">0</property>
-	  <property name="bottom_padding">0</property>
-	  <property name="left_padding">0</property>
-	  <property name="right_padding">0</property>
-
-	  <child>
-	    <widget class="GtkCheckButton" id="burst_on_connect">
-	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="label" translatable="yes">Bu_rst on connect</property>
-	      <property name="use_underline">True</property>
-	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
-	      <property name="active">True</property>
-	      <property name="inconsistent">False</property>
-	      <property name="draw_indicator">True</property>
-	    </widget>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="left_attach">0</property>
-	  <property name="right_attach">1</property>
-	  <property name="top_attach">4</property>
-	  <property name="bottom_attach">5</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options">fill</property>
-	</packing>
-      </child>
-
-      <child>
-	<widget class="GtkAlignment" id="alignment4">
-	  <property name="visible">True</property>
-	  <property name="xalign">0</property>
-	  <property name="yalign">0.5</property>
-	  <property name="xscale">0</property>
-	  <property name="yscale">1</property>
-	  <property name="top_padding">0</property>
-	  <property name="bottom_padding">0</property>
-	  <property name="left_padding">0</property>
-	  <property name="right_padding">0</property>
-
-	  <child>
-	    <widget class="GtkSpinButton" id="port">
-	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="climb_rate">1</property>
-	      <property name="digits">0</property>
-	      <property name="numeric">True</property>
-	      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
-	      <property name="snap_to_ticks">False</property>
-	      <property name="wrap">False</property>
-	      <property name="adjustment">8800 1024 65535 1 10 10</property>
-	    </widget>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="left_attach">1</property>
-	  <property name="right_attach">2</property>
-	  <property name="top_attach">0</property>
-	  <property name="bottom_attach">1</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options">fill</property>
-	</packing>
-      </child>
-
-      <child>
-	<widget class="GtkAlignment" id="alignment5">
-	  <property name="visible">True</property>
-	  <property name="xalign">1</property>
+	  <property name="xalign">0.5</property>
 	  <property name="yalign">0.5</property>
 	  <property name="xscale">1</property>
 	  <property name="yscale">1</property>
 	  <property name="top_padding">0</property>
-	  <property name="bottom_padding">0</property>
+	  <property name="bottom_padding">3</property>
 	  <property name="left_padding">0</property>
 	  <property name="right_padding">0</property>
 
 	  <child>
-	    <widget class="GtkSpinButton" id="client_limit">
+	    <widget class="GtkTable" id="table2">
 	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="climb_rate">1</property>
-	      <property name="digits">0</property>
-	      <property name="numeric">False</property>
-	      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
-	      <property name="snap_to_ticks">False</property>
-	      <property name="wrap">False</property>
-	      <property name="adjustment">500 1 16384 1 10 10</property>
+	      <property name="n_rows">5</property>
+	      <property name="n_columns">3</property>
+	      <property name="homogeneous">False</property>
+	      <property name="row_spacing">6</property>
+	      <property name="column_spacing">6</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label1">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">_Port:</property>
+		  <property name="use_underline">True</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">1</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="mnemonic_widget">port</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">0</property>
+		  <property name="bottom_attach">1</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label7">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Mbit/s</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">2</property>
+		  <property name="right_attach">3</property>
+		  <property name="top_attach">3</property>
+		  <property name="bottom_attach">4</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label6">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">clients</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">2</property>
+		  <property name="right_attach">3</property>
+		  <property name="top_attach">2</property>
+		  <property name="bottom_attach">3</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label4">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">_Mount point:</property>
+		  <property name="use_underline">True</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">1</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="mnemonic_widget">mount_point</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">1</property>
+		  <property name="bottom_attach">2</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment1">
+		  <property name="visible">True</property>
+		  <property name="xalign">1</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">0</property>
+		  <property name="yscale">1</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">0</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="has_client_limit">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">User limit:</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">True</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <signal name="toggled" handler="on_has_client_limit_toggled" last_modification_time="Tue, 12 Jun 2007 14:56:59 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">2</property>
+		  <property name="bottom_attach">3</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment2">
+		  <property name="visible">True</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">0</property>
+		  <property name="yscale">1</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">0</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="has_bandwidth_limit">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">Bandwidth limit:</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <signal name="toggled" handler="on_has_bandwidth_limit_toggled" last_modification_time="Tue, 12 Jun 2007 14:57:04 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">3</property>
+		  <property name="bottom_attach">4</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment3">
+		  <property name="visible">True</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">0</property>
+		  <property name="yscale">1</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">0</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="burst_on_connect">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">Bu_rst on connect</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">True</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">4</property>
+		  <property name="bottom_attach">5</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment4">
+		  <property name="visible">True</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">0</property>
+		  <property name="yscale">1</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">0</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkSpinButton" id="port">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="climb_rate">1</property>
+		      <property name="digits">0</property>
+		      <property name="numeric">True</property>
+		      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+		      <property name="snap_to_ticks">False</property>
+		      <property name="wrap">False</property>
+		      <property name="adjustment">8800 1024 65535 1 10 10</property>
+		    </widget>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="left_attach">1</property>
+		  <property name="right_attach">2</property>
+		  <property name="top_attach">0</property>
+		  <property name="bottom_attach">1</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment5">
+		  <property name="visible">True</property>
+		  <property name="xalign">1</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">1</property>
+		  <property name="yscale">1</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">0</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkSpinButton" id="client_limit">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="climb_rate">1</property>
+		      <property name="digits">0</property>
+		      <property name="numeric">False</property>
+		      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+		      <property name="snap_to_ticks">False</property>
+		      <property name="wrap">False</property>
+		      <property name="adjustment">500 1 16384 1 10 10</property>
+		    </widget>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="left_attach">1</property>
+		  <property name="right_attach">2</property>
+		  <property name="top_attach">2</property>
+		  <property name="bottom_attach">3</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment6">
+		  <property name="visible">True</property>
+		  <property name="xalign">1</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">1</property>
+		  <property name="yscale">1</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">0</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkSpinButton" id="bandwidth_limit">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="climb_rate">1</property>
+		      <property name="digits">2</property>
+		      <property name="numeric">False</property>
+		      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+		      <property name="snap_to_ticks">False</property>
+		      <property name="wrap">False</property>
+		      <property name="adjustment">10 0 1000 1 10 10</property>
+		    </widget>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="left_attach">1</property>
+		  <property name="right_attach">2</property>
+		  <property name="top_attach">3</property>
+		  <property name="bottom_attach">4</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkAlignment" id="alignment7">
+		  <property name="visible">True</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xscale">0</property>
+		  <property name="yscale">1</property>
+		  <property name="top_padding">0</property>
+		  <property name="bottom_padding">0</property>
+		  <property name="left_padding">0</property>
+		  <property name="right_padding">0</property>
+
+		  <child>
+		    <widget class="GtkEntry" id="mount_point">
+		      <property name="width_request">100</property>
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="editable">True</property>
+		      <property name="visibility">True</property>
+		      <property name="max_length">0</property>
+		      <property name="text">/</property>
+		      <property name="has_frame">True</property>
+		      <property name="invisible_char">*</property>
+		      <property name="activates_default">False</property>
+		      <signal name="changed" handler="on_mount_point_changed" last_modification_time="Sun, 05 Jun 2005 16:45:39 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="left_attach">1</property>
+		  <property name="right_attach">2</property>
+		  <property name="top_attach">1</property>
+		  <property name="bottom_attach">2</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
 	    </widget>
 	  </child>
 	</widget>
 	<packing>
-	  <property name="left_attach">1</property>
-	  <property name="right_attach">2</property>
-	  <property name="top_attach">2</property>
-	  <property name="bottom_attach">3</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options">fill</property>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
 	</packing>
       </child>
 
       <child>
-	<widget class="GtkAlignment" id="alignment6">
-	  <property name="visible">True</property>
-	  <property name="xalign">1</property>
-	  <property name="yalign">0.5</property>
-	  <property name="xscale">1</property>
-	  <property name="yscale">1</property>
-	  <property name="top_padding">0</property>
-	  <property name="bottom_padding">0</property>
-	  <property name="left_padding">0</property>
-	  <property name="right_padding">0</property>
-
-	  <child>
-	    <widget class="GtkSpinButton" id="bandwidth_limit">
-	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="climb_rate">1</property>
-	      <property name="digits">2</property>
-	      <property name="numeric">False</property>
-	      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
-	      <property name="snap_to_ticks">False</property>
-	      <property name="wrap">False</property>
-	      <property name="adjustment">10 0 1000 1 10 10</property>
-	    </widget>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="left_attach">1</property>
-	  <property name="right_attach">2</property>
-	  <property name="top_attach">3</property>
-	  <property name="bottom_attach">4</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options">fill</property>
-	</packing>
-      </child>
-
-      <child>
-	<widget class="GtkAlignment" id="alignment7">
-	  <property name="visible">True</property>
-	  <property name="xalign">0</property>
-	  <property name="yalign">0.5</property>
-	  <property name="xscale">0</property>
-	  <property name="yscale">1</property>
-	  <property name="top_padding">0</property>
-	  <property name="bottom_padding">0</property>
-	  <property name="left_padding">0</property>
-	  <property name="right_padding">0</property>
-
-	  <child>
-	    <widget class="GtkEntry" id="mount_point">
-	      <property name="width_request">100</property>
-	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="editable">True</property>
-	      <property name="visibility">True</property>
-	      <property name="max_length">0</property>
-	      <property name="text">/</property>
-	      <property name="has_frame">True</property>
-	      <property name="invisible_char">*</property>
-	      <property name="activates_default">False</property>
-	      <signal name="changed" handler="on_mount_point_changed" last_modification_time="Sun, 05 Jun 2005 16:45:39 GMT"/>
-	    </widget>
-	  </child>
-	</widget>
-	<packing>
-	  <property name="left_attach">1</property>
-	  <property name="right_attach">2</property>
-	  <property name="top_attach">1</property>
-	  <property name="bottom_attach">2</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options">fill</property>
-	</packing>
-      </child>
-
-      <child>
-	<widget class="GtkCheckButton" id="has_cortado">
-	  <property name="can_focus">True</property>
-	  <property name="label" translatable="yes">Embed Java applet</property>
-	  <property name="use_underline">True</property>
-	  <property name="relief">GTK_RELIEF_NORMAL</property>
-	  <property name="focus_on_click">True</property>
-	  <property name="active">False</property>
-	  <property name="inconsistent">False</property>
-	  <property name="draw_indicator">True</property>
-	</widget>
-	<packing>
-	  <property name="left_attach">0</property>
-	  <property name="right_attach">1</property>
-	  <property name="top_attach">5</property>
-	  <property name="bottom_attach">6</property>
-	  <property name="x_options">fill</property>
-	  <property name="y_options"></property>
-	</packing>
+	<placeholder/>
       </child>
     </widget>
   </child>

Modified: flumotion/trunk/flumotion/component/consumers/httpstreamer/http_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/consumers/httpstreamer/http_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/consumers/httpstreamer/http_wizard.py	Fri Feb 15 20:12:25 2008
@@ -39,24 +39,27 @@
 import os
 import random
 
+import gobject
+from kiwi.utils import gsignal
+import gtk
+
 from flumotion.configure import configure
-from flumotion.component.misc.cortado.cortado_location import CORTADO_FILENAME
-from flumotion.wizard.models import Component, Consumer, Plug
+from flumotion.wizard.models import Component, Consumer
 from flumotion.wizard.workerstep import WorkerWizardStep
 
 __version__ = "$Rev$"
 _ = gettext.gettext
-X_ = _
+N_ = _
 
 def _generateRandomString(numchars):
     """Generate a random US-ASCII string of length numchars
     """
-    str = ""
+    s = ""
     chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
-    for _ in range(numchars):
-        str += chars[random.randint(0, len(chars)-1)]
+    for unused in range(numchars):
+        s += chars[random.randint(0, len(chars)-1)]
 
-    return str
+    return s
 
 
 class HTTPPorter(Component):
@@ -96,7 +99,8 @@
         self.has_client_limit = True
         self.has_bandwidth_limit = False
         self.has_cortado = False
-        self.socket_path = '/tmp/flu-xxx.socket'
+        self.has_plugins = False
+        self.socket_path = 'flu-%s.socket' % (_generateRandomString(6),)
         self.porter_username = _generateRandomString(12)
         self.porter_password = _generateRandomString(12)
 
@@ -122,7 +126,7 @@
         if not self.has_client_limit:
             del properties['client-limit']
 
-        if self.has_cortado:
+        if self.has_plugins:
             properties['porter-socket-path'] = self.socket_path
             properties['porter-username'] = self.porter_username
             properties['porter-password'] = self.porter_password
@@ -132,102 +136,111 @@
         return properties
 
 
-class CortadoPlug(Plug):
-    """I am a model representing the configuration file for a
-    Cortado HTTP streaming plug.
+class PlugPluginLine(gtk.VBox):
+    """I am a line in the plug plugin area representing a single plugin.
+    Rendered, I am visible as a checkbutton containing a label with the
+    description of the plugin.
+    Signals::
+      - enable-changed: emitted when I am enabled/disabled
+    @ivar plugin: plugin instance
     """
-    plug_type = "cortado-plug"
-    socket = "flumotion.component.misc.cortado.cortado.CortadoPlug"
-    def __init__(self, server, streamer, audio_producer, video_producer):
+    gsignal('enable-changed')
+    def __init__(self, plugin, description):
         """
-        @param server: server
-        @type  server: L{CortadoHTTPServer}
-        @param streamer: streamer
-        @type  streamer: L{HTTPStreamer}
-        @param audio_producer: audio producer
-        @type  audio_producer: L{flumotion.wizard.models.AudioProducer} subclass or None
-        @param video_producer: video producer
-        @type  video_producer: L{flumotion.wizard.models.VideoProducer} subclass or None
+        @param plugin: plugin instance
+        @param description: description of the plugin
         """
-        super(CortadoPlug, self).__init__()
-        self.server = server
-        self.streamer = streamer
-        self.audio_producer = audio_producer
-        self.video_producer = video_producer
-
-    # Component
+        gtk.VBox.__init__(self)
+        self.plugin = plugin
+        self.checkbutton = gtk.CheckButton(description)
+        self.checkbutton.connect('toggled',
+                                 self._on_checkbutton__toggled)
+        self.pack_start(self.checkbutton)
+        self.checkbutton.show()
+
+    def isEnabled(self):
+        """Find out if the plugin is going to be enabled or not
+        @returns: enabled
+        @rtype: bool
+        """
+        return self.checkbutton.get_active()
 
-    def getProperties(self):
-        p = super(CortadoPlug, self).getProperties()
+    def _on_checkbutton__toggled(self, checkbutton):
+        self.emit('enable-changed')
+gobject.type_register(PlugPluginLine)
 
-        p['codebase'] = self.server.getCodebase()
-        p['stream-url'] = self.streamer.getURL()
-        p['has-video'] = self.video_producer is not None
-        p['has-audio'] = self.audio_producer is not None
-
-        if self.video_producer:
-            width = self.video_producer.properties.width
-            height = self.video_producer.properties.height
-            framerate = self.video_producer.properties.framerate
-        else:
-            width = 320
-            height = 240
-            framerate = 1
 
-        p['width'] = width
-        p['height'] = height
-        p['framerate'] = framerate
-        p['buffer-size'] = 40
-
-        return p
+class PlugPluginArea(gtk.VBox):
+    """I am plugin area representing all available plugins. I keep track
+    of the plugins and their internal state. You can ask me to add new plugins
+    or get the internal models of the plugins.
+    """
+    def __init__(self, streamer):
+        self.streamer = streamer
+        gtk.VBox.__init__(self, spacing=6)
+        self._lines = []
 
+    # Public
 
-class CortadoHTTPServer(Component):
-    """I am a model representing the configuration file for a
-    HTTP server component which will be used to serve a cortado
-    java applet.
-    Most of the interesting logic here is actually in a plug.
-    """
-    component_type = 'http-server'
-    def __init__(self, streamer, audio_producer, video_producer):
+    def addPlug(self, plugin, description):
+        """Add a plug, eg a checkbutton with a description such as
+        'Cortado Java applet'.
+        @param plugin: plugin instance
+        @param description: label description
         """
-        @param streamer: streamer
-        @type  streamer: L{HTTPStreamer}
-        @param audio_producer: audio producer
-        @type  audio_producer: L{flumotion.wizard.models.AudioProducer}
-           subclass or None
-        @param video_producer: video producer
-        @type  video_producer: L{flumotion.wizard.models.VideoProducer}
-           subclass or None
+        line = PlugPluginLine(plugin, description)
+        line.connect('enable-changed', self._on_plugline__enable_changed)
+        self._lines.append(line)
+        self.pack_start(line, False, False)
+        line.show()
+
+    def getPorters(self):
+        """Fetch a list of porters which are going to be used by all
+        available plugins.
+        @returns: porters
+        @rtype: a sequence of L{HTTPPorters}
         """
-        self.streamer = streamer
+        for unused in self._getEnabledPlugins():
+            yield HTTPPorter(self.streamer)
 
-        super(CortadoHTTPServer, self).__init__(worker=streamer.worker)
-
-        self.properties.mount_point = "/cortado"
-        self.properties.porter_socket_path = streamer.socket_path
-        self.properties.porter_username = streamer.porter_username
-        self.properties.porter_password = streamer.porter_password
-        self.properties.type = 'slave'
-
-        plug = CortadoPlug(self, streamer, audio_producer, video_producer)
-        self.addPlug(plug)
-
-    def getCodebase(self):
-        """Returns the base of directory of the applet
-        @returns: directory
+    def getServerConsumers(self, audio_producer, video_producer):
+        """Fetch a list of server consumers which are going to be used by all
+        available plugins.
+        @returns: consumers
+        @rtype: a sequence of L{HTTPServer} subclasses
         """
-        return 'http://%s:%d%s/' % (self.worker,
-                                    self.streamer.properties.port,
-                                    self.properties.mount_point)
+        for plugin in self._getEnabledPlugins():
+            yield plugin.getConsumer(self.streamer, audio_producer,
+                                     video_producer)
+
+    # Private
+
+    def _hasEnabledPlugins(self):
+        for line in self._lines:
+            if line.isEnabled():
+                return True
+        return False
+
+    def _getEnabledPlugins(self):
+        for line in self._lines:
+            if line.isEnabled():
+                yield line.plugin
+
+    # Callbacks
+
+    def _on_plugline__enable_changed(self, line):
+        self.streamer.has_plugins = self._hasEnabledPlugins()
 
 
 class HTTPStep(WorkerWizardStep):
     """I am a step of the configuration wizard which allows you
     to configure a stream to be served over HTTP.
     """
-    glade_file = os.path.join(os.path.dirname(os.path.abspath(__file__)),
-                              'http-wizard.glade')
+    glade_file = os.path.join(
+        os.path.dirname(
+        os.path.abspath(__file__)),
+        'http-wizard.glade')
+
     section = _('Consumption')
     component_type = 'http-streamer'
 
@@ -242,28 +255,21 @@
         """
         return self.model
 
-    def getServerConsumer(self):
+    def getServerConsumers(self):
         """Returns the http-server consumer model or None
         if there will only a stream served.
         @returns: the server consumer or None
         """
-        if not self.model.has_cortado:
-            return None
-
         source_step = self.wizard.get_step('Source')
+        return self.plugarea.getServerConsumers(
+           source_step.get_audio_producer(),
+           source_step.get_video_producer())
 
-        return CortadoHTTPServer(self.model,
-                                 source_step.get_audio_producer(),
-                                 source_step.get_video_producer())
-
-    def getPorter(self):
+    def getPorters(self):
         """Returns the porter model or None if there will only a stream served.
         @returns: the porter or None
         """
-        if not self.model.has_cortado:
-            return None
-
-        return HTTPPorter(self.model)
+        return self.plugarea.getPorters()
 
     # WizardStep
 
@@ -275,14 +281,15 @@
 
         self.port.set_value(self.default_port)
 
-        if self._canEmbedCortado():
-            self.model.has_cortado = True
-            self.has_cortado.show()
+        self.plugarea = PlugPluginArea(self.model)
+        self.main_vbox.pack_start(self.plugarea, False, False)
+        self.plugarea.show()
+
+        self._populate_plugins()
 
         self.add_proxy(self.model,
                        ['has_client_limit',
-                        'has_bandwidth_limit',
-                        'has_cortado'])
+                        'has_bandwidth_limit'])
 
         self.add_proxy(self.model.properties,
                        ['port',
@@ -306,31 +313,54 @@
 
     # Private
 
-    def _canEmbedCortado(self):
-        # Empty string means that it couldn't be found by configure
-        if not CORTADO_FILENAME:
-            return False
+    def _populate_plugins(self):
+        def got_entries(entries):
+            for entry in entries:
+                def response(factory, entry):
+                    plugin = factory(self.wizard)
+                    if hasattr(plugin, 'worker_changed'):
+                        d = plugin.worker_changed(self.worker)
+                        def cb(found, plugin, entry):
+                            if found:
+                                self._addPlug(plugin, entry)
+                        d.addCallback(cb, plugin, entry)
+                    else:
+                        self._addPlug(plugin, entry)
+                d = self.wizard.get_wizard_plug_entry(entry.component_type)
+                d.addCallback(response, entry)
+
+        d = self.wizard._admin.getWizardEntries(
+            wizard_types=['http-consumer'])
+        d.addCallback(got_entries)
+
+    def _addPlug(self, plugin, entry):
+        # This function filters out entries which are
+        # not matching the accepted media types of the entry
+        muxerTypes = []
+        audioTypes = []
+        videoTypes = []
+        for mediaType in entry.getAcceptedMediaTypes():
+            kind, name = mediaType.split(':', 1)
+            if kind == 'muxer':
+                muxerTypes.append(name)
+            elif kind == 'video':
+                videoTypes.append(name)
+            elif kind == 'audio':
+                audioTypes.append(name)
+            else:
+                raise AssertionError
 
         encoding_step = self.wizard.get_step('Encoding')
-        if encoding_step.get_muxer_type() not in [
-            'ogg-muxer',
-            'multipart-muxer']:
-            return False
-
-        audio_encoder = encoding_step.get_audio_encoder()
-        if audio_encoder and audio_encoder.component_type not in [
-            'vorbis-encoder',
-            'mulaw-encoder']:
-            return False
-
-        video_encoder = encoding_step.get_video_encoder()
-        if video_encoder and video_encoder.component_type not in [
-            'theora-encoder',
-            'jpeg-encoder',
-            'smoke-encoder']:
-            return False
+        if encoding_step.get_muxer_format() not in muxerTypes:
+            return
+
+        audio_format = encoding_step.get_audio_format()
+        video_format = encoding_step.get_video_format()
+        if ((audio_format and audio_format not in audioTypes) or
+            (video_format and video_format not in videoTypes)):
+            return
 
-        return True
+        self.plugarea.addPlug(plugin, N_(entry.description))
 
     def _check_elements(self):
         def got_missing(missing):

Modified: flumotion/trunk/flumotion/component/misc/cortado/Makefile.am
==============================================================================
--- flumotion/trunk/flumotion/component/misc/cortado/Makefile.am	(original)
+++ flumotion/trunk/flumotion/component/misc/cortado/Makefile.am	Fri Feb 15 20:12:25 2008
@@ -5,7 +5,8 @@
 cortado_PYTHON = 		\
 	__init__.py 		\
 	cortado.py 		\
-	cortado_location.py 
+	cortado_location.py 	\
+	cortado_wizard.py 
 
 cortado_DATA = cortado.xml
 

Modified: flumotion/trunk/flumotion/component/misc/cortado/cortado.py
==============================================================================
--- flumotion/trunk/flumotion/component/misc/cortado/cortado.py	(original)
+++ flumotion/trunk/flumotion/component/misc/cortado/cortado.py	Fri Feb 15 20:12:25 2008
@@ -27,7 +27,7 @@
 from flumotion.common import log
 from flumotion.common.errors import ComponentStartError
 from flumotion.component.misc.httpfile.httpfile import HTTPFileStreamer
-from flumotion.component.misc.cortado.cortado_location import CORTADO_FILENAME
+from flumotion.component.misc.cortado.cortado_location import getCortadoFilename
 from flumotion.component.plugs.base import ComponentPlug
 from flumotion.configure import configure
 
@@ -46,7 +46,7 @@
     - cortado.jar - cortado java applet
     """
 
-    def __init__(self, mount_point, properties):
+    def __init__(self, mount_point, properties, filename):
         Resource.__init__(self)
 
         index_name = properties.get('index', 'index.html')
@@ -60,12 +60,13 @@
         self._properties = properties
         self._index_content = self._get_index_content()
         self._index_name = index_name
-
+        self._cortado_filename = filename
         self._addChildren()
 
     def _addChildren(self):
         self.putChild("cortado.jar",
-                      File(CORTADO_FILENAME, 'application/x-java-archive'))
+                      File(self._cortado_filename,
+                           'application/x-java-archive'))
 
         self.putChild(self._index_name,
                       self._index_content)
@@ -105,7 +106,7 @@
 
 class CortadoPlug(ComponentPlug):
     """I am a component plug for a http-server which plugs in a
-    http resource containing a cortado java applaet.
+    http resource containing a cortado java applet.
     """
     def start(self, component):
         """
@@ -116,9 +117,14 @@
                 "A CortadoPlug %s must be plugged into a "
                 " HTTPStreamer component, not a %s" % (
                 self, component.__class__.__name__))
+        filename = getCortadoFilename()
+        if not filename:
+            raise ComponentStartError(
+                "Could not find cortado jar file")
         log.debug('cortado', 'Attaching to %r' % (component,))
         resource = CortadoDirectoryResource(component.getMountPoint(),
-                                            self.args['properties'])
+                                            self.args['properties'],
+                                            filename)
         component.setRootResource(resource)
 
 
@@ -137,7 +143,7 @@
                   'stream-url' : '/stream.ogg',
                   'buffer-size': 40,
                   'framerate' : 1}
-    root = CortadoDirectoryResource('/', properties)
+    root = CortadoDirectoryResource('/', properties, getCortadoFilename())
     site = Site(root)
 
     reactor.listenTCP(8080, site)

Modified: flumotion/trunk/flumotion/component/misc/cortado/cortado.xml
==============================================================================
--- flumotion/trunk/flumotion/component/misc/cortado/cortado.xml	(original)
+++ flumotion/trunk/flumotion/component/misc/cortado/cortado.xml	Fri Feb 15 20:12:25 2008
@@ -2,8 +2,24 @@
   <plugs>
     <plug socket="flumotion.component.plugs.lifecycle.ComponentLifecycle"
           type="cortado-plug">
-      <entry location="flumotion/component/misc/cortado/cortado.py"
-             function="CortadoPlug" />
+      <entries>
+        <entry type="default"
+               location="flumotion/component/misc/cortado/cortado.py"
+               function="CortadoPlug" />
+        <entry type="wizard"
+               location="flumotion/component/misc/cortado/cortado_wizard.py"
+               function="CortadoWizardPlugin" />
+      </entries>
+      <wizard _description="Stream to Java" type="http-consumer" 
+              feeder="default" eater="default">
+        <accept-format media-type="muxer:ogg"/>
+        <accept-format media-type="muxer:multipart"/>
+        <accept-format media-type="audio:vorbis"/>
+        <accept-format media-type="audio:mulaw"/>
+        <accept-format media-type="video:theora"/>
+        <accept-format media-type="video:jpeg"/>
+        <accept-format media-type="video:smoke"/>
+      </wizard>
       <properties>
         <property name="width" type="int" required="true"  
                   description="width of the cortado applet" />
@@ -37,6 +53,7 @@
         <directory name="flumotion/component/misc/cortado">
           <filename location="__init__.py" />
           <filename location="cortado.py" />
+          <filename location="cortado_wizard.py" />
         </directory>
       </directories>
     </bundle>

Modified: flumotion/trunk/flumotion/component/misc/cortado/cortado_location.py.in
==============================================================================
--- flumotion/trunk/flumotion/component/misc/cortado/cortado_location.py.in	(original)
+++ flumotion/trunk/flumotion/component/misc/cortado/cortado_location.py.in	Fri Feb 15 20:12:25 2008
@@ -19,4 +19,21 @@
 
 # Headers in this file shall remain intact.
 
-CORTADO_FILENAME = "@CORTADO_FILENAME@"
+import os
+
+CORTADO_PREFIX = "@CORTADO_PREFIX@"
+
+def getCortadoFilename():
+    directories = ['/usr/local', '/usr']
+    prefix = CORTADO_PREFIX[:]
+    if prefix:
+        if prefix.endswith('/'):
+            prefix = prefix[1:]
+        directories.insert(0, CORTADO_PREFIX)
+    for directory in directories:
+        for version in ['0.2.2', '0.2.1', '0.2.0']:
+            name = os.path.join(directory, 'share', 'cortado',
+                                'cortado-ovt-stripped-%s.1.jar' % (version,))
+            if os.path.exists(name):
+                return name
+    return None

Modified: flumotion/trunk/flumotion/wizard/configurationwizard.py
==============================================================================
--- flumotion/trunk/flumotion/wizard/configurationwizard.py	(original)
+++ flumotion/trunk/flumotion/wizard/configurationwizard.py	Fri Feb 15 20:12:25 2008
@@ -358,6 +358,27 @@
         d.addCallback(got_entry_point)
         return d
 
+    def get_wizard_plug_entry(self, plug_type):
+        """
+        Fetches a wizard bundle from a specific kind of plug
+        @param plug_type: the plug type to get the wizard entry
+          bundle from.
+        @returns: a deferred returning either::
+          - factory of the plug
+          - noBundle error: if the plug lacks a wizard bundle
+        """
+        def got_entry_point((filename, procname)):
+            modname = pathToModuleName(filename)
+            d = self._admin.getBundledFunction(modname, procname)
+            self.clear_msg('wizard-bundle')
+            return d
+
+        self.clear_msg('wizard-bundle')
+        d = self._admin.callRemote('getPlugEntry', plug_type, 'wizard')
+        d.addCallback(got_entry_point)
+        return d
+
+
     # Private
 
     def _setup_worker(self, step, worker):

Modified: flumotion/trunk/flumotion/wizard/conversionsteps.py
==============================================================================
--- flumotion/trunk/flumotion/wizard/conversionsteps.py	(original)
+++ flumotion/trunk/flumotion/wizard/conversionsteps.py	Fri Feb 15 20:12:25 2008
@@ -79,6 +79,32 @@
         entry = self.muxer.get_selected()
         return entry.component_type
 
+    def get_muxer_format(self):
+        """Returns the format of the muxer, such as "ogg".
+        @returns: the muxer format
+        @rtype: string
+        """
+        entry = self.muxer.get_selected()
+        return entry.getProvidedMediaTypes()[0]
+
+    def get_audio_format(self):
+        """Returns the format of the audio encoder, such as "vorbis"
+        @returns: the audio format
+        @rtype: string
+        """
+        if self._audio_encoder:
+            entry = self.audio.get_selected()
+            return entry.getProvidedMediaTypes()[0]
+
+    def get_video_format(self):
+        """Returns the format of the video encoder, such as "theora"
+        @returns: the video format
+        @rtype: string
+        """
+        if self._video_encoder:
+            entry = self.video.get_selected()
+            return entry.getProvidedMediaTypes()[0]
+
     # WizardStep
 
     def setup(self):

Modified: flumotion/trunk/flumotion/wizard/models.py
==============================================================================
--- flumotion/trunk/flumotion/wizard/models.py	(original)
+++ flumotion/trunk/flumotion/wizard/models.py	Fri Feb 15 20:12:25 2008
@@ -321,3 +321,38 @@
 
     eater_type = VideoProducer
     name_template = "video-encoder"
+
+
+class HTTPServer(Component):
+    component_type = 'http-server'
+
+    def __init__(self, worker, mount_point):
+        """
+        @param mount_point:
+        @type  mount_point:
+        """
+        super(HTTPServer, self).__init__(worker=worker)
+
+        self.properties.mount_point = mount_point
+
+
+class HTTPPlug(Plug):
+    def __init__(self, server, streamer, audio_producer, video_producer):
+        """
+        @param server: server
+        @type  server: L{HTTPServer} subclass
+        @param streamer: streamer
+        @type  streamer: L{HTTPStreamer}
+        @param audio_producer: audio producer
+        @type  audio_producer: L{flumotion.wizard.models.AudioProducer}
+          subclass or None
+        @param video_producer: video producer
+        @type  video_producer: L{flumotion.wizard.models.VideoProducer}
+          subclass or None
+        """
+        super(HTTPPlug, self).__init__()
+        self.server = server
+        self.streamer = streamer
+        self.audio_producer = audio_producer
+        self.video_producer = video_producer
+

Modified: flumotion/trunk/flumotion/wizard/save.py
==============================================================================
--- flumotion/trunk/flumotion/wizard/save.py	(original)
+++ flumotion/trunk/flumotion/wizard/save.py	Fri Feb 15 20:12:25 2008
@@ -208,25 +208,23 @@
                          encoding_step.worker)
 
     def _handleHTTPConsumer(self, name, step):
-        server = step.getServerConsumer()
-        if server is not None:
-            server = Component('server1',
+        for server in step.getServerConsumers():
+            server = Component('http-server-%s' % (name,),
                                server.component_type,
                                server.getWorker(),
                                server.getProperties(),
                                server.getPlugs())
             self._flow_components.append(server)
 
-        porter = step.getPorter()
-        if porter is not None:
-            porter = Component('porter1',
+        for porter in step.getPorters():
+            porter = Component('porter-%s' % (name,),
                                porter.component_type,
                                porter.getWorker(),
                                porter.getProperties())
             self._atmosphere_components.append(porter)
 
         streamer = step.getStreamerConsumer()
-        return Component(name,
+        return Component('http-%s' % (name,),
                          streamer.component_type,
                          streamer.getWorker(),
                          streamer.getProperties())
@@ -361,7 +359,7 @@
                 continue
             step = self.wizard.get_step(step_name)
             if comp_type == 'http-streamer':
-                consumer = self._handleHTTPConsumer(name, step)
+                consumer = self._handleHTTPConsumer(name[5:], step)
             else:
                 consumer = Component(
                     name, comp_type,

Modified: flumotion/trunk/flumotion/worker/checks/Makefile.am
==============================================================================
--- flumotion/trunk/flumotion/worker/checks/Makefile.am	(original)
+++ flumotion/trunk/flumotion/worker/checks/Makefile.am	Fri Feb 15 20:12:25 2008
@@ -9,6 +9,7 @@
 	video.py	\
 	gst010.py	\
 	audio.py	\
+	cortado.py	\
 	package.xml
 
 TAGS_FILES = $(flumotion_PYTHON)

Modified: flumotion/trunk/flumotion/worker/checks/package.xml
==============================================================================
--- flumotion/trunk/flumotion/worker/checks/package.xml	(original)
+++ flumotion/trunk/flumotion/worker/checks/package.xml	Fri Feb 15 20:12:25 2008
@@ -8,6 +8,7 @@
           <filename location="video.py" />
 	  <filename location="audio.py" />
           <filename location="gst010.py" />
+          <filename location="cortado.py" />
         </directory>
       </directories>
     </bundle>


More information about the flumotion-commit mailing list