r6189 - in flumotion/trunk: . flumotion/component/consumers/httpstreamer flumotion/component/encoders/jpeg flumotion/component/encoders/smoke flumotion/component/encoders/speex flumotion/component/encoders/theora flumotion/component/encoders/vorbis flumotion/component/producers/audiotest flumotion/component/producers/bttv flumotion/component/producers/firewire flumotion/component/producers/soundcard flumotion/component/producers/videotest flumotion/component/producers/webcam flumotion/wizard

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Thu Feb 7 15:18:27 CET 2008


Author: jdahlin
Date: Thu Feb  7 15:18:23 2008
New Revision: 6189

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

	* flumotion/component/consumers/httpstreamer/http_wizard.py:
	* flumotion/component/encoders/jpeg/jpeg_wizard.py:
	* flumotion/component/encoders/smoke/smoke_wizard.py:
	* flumotion/component/encoders/speex/speex_wizard.py:
	* flumotion/component/encoders/theora/theora_wizard.py:
	* flumotion/component/encoders/vorbis/vorbis_wizard.py:
	* flumotion/component/producers/audiotest/audiotest_wizard.py:
	* flumotion/component/producers/bttv/bttv_wizard.py:
	* flumotion/component/producers/firewire/firewire_wizard.py:
	* flumotion/component/producers/soundcard/soundcard_wizard.py:
	* flumotion/component/producers/videotest/videotest_wizard.py:
	* flumotion/component/producers/webcam/webcam_wizard.py:
	* flumotion/wizard/basesteps.py:
	* flumotion/wizard/configurationwizard.py:
	* flumotion/wizard/conversionsteps.py:
	* flumotion/wizard/productionsteps.py:

	Change worker_changed to take a worker argument to simplify the
	callsites slightly.



Modified:
   flumotion/trunk/ChangeLog
   flumotion/trunk/flumotion/component/consumers/httpstreamer/http_wizard.py
   flumotion/trunk/flumotion/component/encoders/jpeg/jpeg_wizard.py
   flumotion/trunk/flumotion/component/encoders/smoke/smoke_wizard.py
   flumotion/trunk/flumotion/component/encoders/speex/speex_wizard.py
   flumotion/trunk/flumotion/component/encoders/theora/theora_wizard.py
   flumotion/trunk/flumotion/component/encoders/vorbis/vorbis_wizard.py
   flumotion/trunk/flumotion/component/producers/audiotest/audiotest_wizard.py
   flumotion/trunk/flumotion/component/producers/bttv/bttv_wizard.py
   flumotion/trunk/flumotion/component/producers/firewire/firewire_wizard.py
   flumotion/trunk/flumotion/component/producers/soundcard/soundcard_wizard.py
   flumotion/trunk/flumotion/component/producers/videotest/videotest_wizard.py
   flumotion/trunk/flumotion/component/producers/webcam/webcam_wizard.py
   flumotion/trunk/flumotion/wizard/basesteps.py
   flumotion/trunk/flumotion/wizard/configurationwizard.py
   flumotion/trunk/flumotion/wizard/conversionsteps.py
   flumotion/trunk/flumotion/wizard/productionsteps.py

Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Thu Feb  7 15:18:23 2008
@@ -1,5 +1,27 @@
 2008-02-07  Johan Dahlin  <johan at gnome.org>
 
+	* flumotion/component/consumers/httpstreamer/http_wizard.py:
+	* flumotion/component/encoders/jpeg/jpeg_wizard.py:
+	* flumotion/component/encoders/smoke/smoke_wizard.py:
+	* flumotion/component/encoders/speex/speex_wizard.py:
+	* flumotion/component/encoders/theora/theora_wizard.py:
+	* flumotion/component/encoders/vorbis/vorbis_wizard.py:
+	* flumotion/component/producers/audiotest/audiotest_wizard.py:
+	* flumotion/component/producers/bttv/bttv_wizard.py:
+	* flumotion/component/producers/firewire/firewire_wizard.py:
+	* flumotion/component/producers/soundcard/soundcard_wizard.py:
+	* flumotion/component/producers/videotest/videotest_wizard.py:
+	* flumotion/component/producers/webcam/webcam_wizard.py:
+	* flumotion/wizard/basesteps.py:
+	* flumotion/wizard/configurationwizard.py:
+	* flumotion/wizard/conversionsteps.py:
+	* flumotion/wizard/productionsteps.py:
+
+	Change worker_changed to take a worker argument to simplify the
+	callsites slightly.
+
+2008-02-07  Johan Dahlin  <johan at gnome.org>
+
 	* flumotion/wizard/configurationwizard.py:
 	Call block_next before requiring an element and block_next when
 	we're done.

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	Thu Feb  7 15:18:23 2008
@@ -297,8 +297,8 @@
         self._check_elements()
         self._verify()
 
-    def worker_changed(self):
-        self.model.worker = self.worker
+    def worker_changed(self, worker):
+        self.model.worker = worker
         self._check_elements()
 
     def get_next(self):

Modified: flumotion/trunk/flumotion/component/encoders/jpeg/jpeg_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/encoders/jpeg/jpeg_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/encoders/jpeg/jpeg_wizard.py	Thu Feb  7 15:18:23 2008
@@ -2,7 +2,7 @@
 # vi:si:et:sw=4:sts=4:ts=4
 #
 # Flumotion - a streaming media server
-# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
+# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
 # All rights reserved.
 
 # This file may be distributed and/or modified under the terms of
@@ -68,9 +68,9 @@
         self.add_proxy(self.model.properties,
                        ['framerate', 'quality'])
 
-    def worker_changed(self):
-        self.model.worker = self.worker
-        self.wizard.require_elements(self.worker, 'jpegenc')
+    def worker_changed(self, worker):
+        self.model.worker = worker
+        self.wizard.require_elements(worker, 'jpegenc')
 
     def get_next(self):
         return self.wizard.get_step('Encoding').get_audio_page()

Modified: flumotion/trunk/flumotion/component/encoders/smoke/smoke_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/encoders/smoke/smoke_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/encoders/smoke/smoke_wizard.py	Thu Feb  7 15:18:23 2008
@@ -2,7 +2,7 @@
 # vi:si:et:sw=4:sts=4:ts=4
 #
 # Flumotion - a streaming media server
-# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
+# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
 # All rights reserved.
 
 # This file may be distributed and/or modified under the terms of
@@ -43,9 +43,9 @@
 
     # WizardStep
 
-    def worker_changed(self):
-        self.model.worker = self.worker
-        self.wizard.require_elements(self.worker, 'smokeenc')
+    def worker_changed(self, worker):
+        self.model.worker = worker
+        self.wizard.require_elements(worker, 'smokeenc')
 
     def get_next(self):
         return self.wizard.get_step('Encoding').get_audio_page()

Modified: flumotion/trunk/flumotion/component/encoders/speex/speex_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/encoders/speex/speex_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/encoders/speex/speex_wizard.py	Thu Feb  7 15:18:23 2008
@@ -2,7 +2,7 @@
 # vi:si:et:sw=4:sts=4:ts=4
 #
 # Flumotion - a streaming media server
-# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
+# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
 # All rights reserved.
 
 # This file may be distributed and/or modified under the terms of
@@ -59,9 +59,9 @@
 
         self.add_proxy(self.model.properties, ['bitrate'])
 
-    def worker_changed(self):
-        self.model.worker = self.worker
-        self.wizard.require_elements(self.worker, 'speexenc')
+    def worker_changed(self, worker):
+        self.model.worker = worker
+        self.wizard.require_elements(worker, 'speexenc')
 
 
 class SpeexWizardPlugin(object):

Modified: flumotion/trunk/flumotion/component/encoders/theora/theora_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/encoders/theora/theora_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/encoders/theora/theora_wizard.py	Thu Feb  7 15:18:23 2008
@@ -2,7 +2,7 @@
 # vi:si:et:sw=4:sts=4:ts=4
 #
 # Flumotion - a streaming media server
-# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
+# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
 # All rights reserved.
 
 # This file may be distributed and/or modified under the terms of
@@ -86,16 +86,16 @@
     def get_next(self):
         return self.wizard.get_step('Encoding').get_audio_page()
 
-    def worker_changed(self):
-        self.model.worker = self.worker
+    def worker_changed(self, worker):
+        self.model.worker = worker
 
-        def hasTheora(unused):
+        def hasTheora(unused, worker):
             self.wizard.run_in_worker(
-                self.worker, 'flumotion.worker.checks.encoder', 'checkTheora')
+                worker, 'flumotion.worker.checks.encoder', 'checkTheora')
 
         self.wizard.debug('running Theora checks')
-        d = self.wizard.require_elements(self.worker, 'theoraenc')
-        d.addCallback(hasTheora)
+        d = self.wizard.require_elements(worker, 'theoraenc')
+        d.addCallback(hasTheora, worker)
 
     # Callbacks
 

Modified: flumotion/trunk/flumotion/component/encoders/vorbis/vorbis_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/encoders/vorbis/vorbis_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/encoders/vorbis/vorbis_wizard.py	Thu Feb  7 15:18:23 2008
@@ -2,7 +2,7 @@
 # vi:si:et:sw=4:sts=4:ts=4
 #
 # Flumotion - a streaming media server
-# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
+# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
 # All rights reserved.
 
 # This file may be distributed and/or modified under the terms of
@@ -73,16 +73,16 @@
         self.add_proxy(self.model.properties,
                        ['bitrate', 'quality'])
 
-    def worker_changed(self):
-        self.model.worker = self.worker
+    def worker_changed(self, worker):
+        self.model.worker = worker
 
-        def hasVorbis(unused):
+        def hasVorbis(unused, worker):
             self.wizard.run_in_worker(
-                self.worker, 'flumotion.worker.checks.encoder', 'checkVorbis')
+                worker, 'flumotion.worker.checks.encoder', 'checkVorbis')
 
         self.wizard.debug('running Vorbis checks')
-        d = self.wizard.require_elements(self.worker, 'vorbisenc')
-        d.addCallback(hasVorbis)
+        d = self.wizard.require_elements(worker, 'vorbisenc')
+        d.addCallback(hasVorbis, worker)
 
     # Callbacks
 

Modified: flumotion/trunk/flumotion/component/producers/audiotest/audiotest_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/producers/audiotest/audiotest_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/producers/audiotest/audiotest_wizard.py	Thu Feb  7 15:18:23 2008
@@ -59,9 +59,9 @@
 
         self.rate.set_sensitive(True)
 
-    def worker_changed(self):
-        self.model.worker = self.worker
-        self.wizard.require_elements(self.worker, 'audiotestsrc')
+    def worker_changed(self, worker):
+        self.model.worker = worker
+        self.wizard.require_elements(worker, 'audiotestsrc')
 
     def get_next(self):
         return None

Modified: flumotion/trunk/flumotion/component/producers/bttv/bttv_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/producers/bttv/bttv_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/producers/bttv/bttv_wizard.py	Thu Feb  7 15:18:23 2008
@@ -82,8 +82,8 @@
 
         self._in_setup = False
 
-    def worker_changed(self):
-        self.model.worker = self.worker
+    def worker_changed(self, worker):
+        self.model.worker = worker
         self._clear_combos()
         self._run_checks()
 

Modified: flumotion/trunk/flumotion/component/producers/firewire/firewire_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/producers/firewire/firewire_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/producers/firewire/firewire_wizard.py	Thu Feb  7 15:18:23 2008
@@ -72,8 +72,8 @@
 
     # WizardStep
 
-    def worker_changed(self):
-        self.model.worker = self.worker
+    def worker_changed(self, worker):
+        self.model.worker = worker
         self._run_checks()
 
     # Private

Modified: flumotion/trunk/flumotion/component/producers/soundcard/soundcard_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/producers/soundcard/soundcard_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/producers/soundcard/soundcard_wizard.py	Thu Feb  7 15:18:23 2008
@@ -2,7 +2,7 @@
 # vi:si:et:sw=4:sts=4:ts=4
 #
 # Flumotion - a streaming media server
-# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
+# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
 # All rights reserved.
 
 # This file may be distributed and/or modified under the terms of
@@ -110,8 +110,8 @@
 
         self._block_update = False
 
-    def worker_changed(self):
-        self.model.worker = self.worker
+    def worker_changed(self, worker):
+        self.model.worker = worker
         self._clear_combos()
         self._update_devices()
         self._update_inputs()

Modified: flumotion/trunk/flumotion/component/producers/videotest/videotest_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/producers/videotest/videotest_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/producers/videotest/videotest_wizard.py	Thu Feb  7 15:18:23 2008
@@ -65,9 +65,9 @@
                        ['pattern', 'width', 'height',
                         'framerate', 'format'])
 
-    def worker_changed(self):
-        self.model.worker = self.worker
-        self.wizard.require_elements(self.worker, 'videotestsrc')
+    def worker_changed(self, worker):
+        self.model.worker = worker
+        self.wizard.require_elements(worker, 'videotestsrc')
 
 
 class VideoTestWizardPlugin(object):

Modified: flumotion/trunk/flumotion/component/producers/webcam/webcam_wizard.py
==============================================================================
--- flumotion/trunk/flumotion/component/producers/webcam/webcam_wizard.py	(original)
+++ flumotion/trunk/flumotion/component/producers/webcam/webcam_wizard.py	Thu Feb  7 15:18:23 2008
@@ -71,8 +71,8 @@
 
         self._in_setup = False
 
-    def worker_changed(self):
-        self.model.worker = self.worker
+    def worker_changed(self, worker):
+        self.model.worker = worker
         self._clear()
         self._run_checks()
 

Modified: flumotion/trunk/flumotion/wizard/basesteps.py
==============================================================================
--- flumotion/trunk/flumotion/wizard/basesteps.py	(original)
+++ flumotion/trunk/flumotion/wizard/basesteps.py	Thu Feb  7 15:18:23 2008
@@ -2,7 +2,7 @@
 # vi:si:et:sw=4:sts=4:ts=4
 #
 # Flumotion - a streaming media server
-# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
+# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
 # All rights reserved.
 
 # This file may be distributed and/or modified under the terms of
@@ -35,8 +35,11 @@
         WizardStep.__init__(self, wizard)
         self.worker = None
 
-    def worker_changed(self):
-        pass
+    def worker_changed(self, worker):
+        """This is called when a worker changed.
+        Can be overridden in a subclass
+        @param worker: the new worker
+        """
 
     def run_in_worker(self, module, function, *args, **kwargs):
         return self.wizard.run_in_worker(self.worker, module, function,
@@ -106,8 +109,8 @@
 
     # Wizard Step
 
-    def worker_changed(self):
-        self._worker_changed()
+    def worker_changed(self, worker):
+        self._worker_changed(worker)
 
     def get_next(self):
         if self.wizard.get_step_option('Source', 'has-audio'):
@@ -121,7 +124,7 @@
 
     # Private API
 
-    def _worker_changed(self):
+    def _worker_changed(self, worker):
         self.can_overlay = False
         self.set_sensitive(False)
 
@@ -162,7 +165,7 @@
 
         # first check elements
         d = self.wizard.check_elements(
-            self.worker, 'pngenc', 'ffmpegcolorspace', 'videomixer')
+            worker, 'pngenc', 'ffmpegcolorspace', 'videomixer')
         d.addCallback(checkElements)
 
     def on_show_text__toggled(self, button):

Modified: flumotion/trunk/flumotion/wizard/configurationwizard.py
==============================================================================
--- flumotion/trunk/flumotion/wizard/configurationwizard.py	(original)
+++ flumotion/trunk/flumotion/wizard/configurationwizard.py	Thu Feb  7 15:18:23 2008
@@ -2,7 +2,7 @@
 # vi:si:et:sw=4:sts=4:ts=4
 #
 # Flumotion - a streaming media server
-# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
+# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
 # All rights reserved.
 
 # This file may be distributed and/or modified under the terms of
@@ -399,7 +399,7 @@
             if step and isinstance(step, WorkerWizardStep):
                 self._setup_worker(step, worker)
                 self.debug('calling %r.worker_changed' % step)
-                step.worker_changed()
+                step.worker_changed(worker)
         else:
             msg = messages.Error(T_(
                     N_('All workers have logged out.\n'

Modified: flumotion/trunk/flumotion/wizard/conversionsteps.py
==============================================================================
--- flumotion/trunk/flumotion/wizard/conversionsteps.py	(original)
+++ flumotion/trunk/flumotion/wizard/conversionsteps.py	Thu Feb  7 15:18:23 2008
@@ -2,7 +2,7 @@
 # vi:si:et:sw=4:sts=4:ts=4
 #
 # Flumotion - a streaming media server
-# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
+# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
 # All rights reserved.
 
 # This file may be distributed and/or modified under the terms of
@@ -168,7 +168,7 @@
             step = plugin.getConversionStep()
             if isinstance(step, WorkerWizardStep):
                 step.worker = self.worker
-                step.worker_changed()
+                step.worker_changed(self.worker)
             return step
 
         d = self._load_plugin(entry)

Modified: flumotion/trunk/flumotion/wizard/productionsteps.py
==============================================================================
--- flumotion/trunk/flumotion/wizard/productionsteps.py	(original)
+++ flumotion/trunk/flumotion/wizard/productionsteps.py	Thu Feb  7 15:18:23 2008
@@ -2,7 +2,7 @@
 # vi:si:et:sw=4:sts=4:ts=4
 #
 # Flumotion - a streaming media server
-# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
+# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
 # All rights reserved.
 
 # This file may be distributed and/or modified under the terms of
@@ -162,7 +162,7 @@
             step = plugin.getProductionStep(type)
             if isinstance(step, WorkerWizardStep):
                 step.worker = self.worker
-                step.worker_changed()
+                step.worker_changed(self.worker)
             return step
 
         d = self._load_plugin(combo.get_selected(), type)


More information about the flumotion-commit mailing list