[pitivi] Some code cleanup



commit 6a70b7e8b448f60b1176e3ecab482dbea09da4a1
Author: Thibault Saunier <tsaunier gnome org>
Date:   Tue Jul 27 17:45:49 2010 +0200

    Some code cleanup

 pitivi/effects.py             |    8 ++++----
 pitivi/factories/operation.py |    6 ++++--
 pitivi/timeline/timeline.py   |    3 ++-
 pitivi/ui/gstwidget.py        |    2 +-
 4 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/pitivi/effects.py b/pitivi/effects.py
index 422387e..1c67584 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -123,10 +123,10 @@ class EffectsHandler(object):
               not in BLACKLISTED_EFFECTS:
                 name = element_factory.get_name()
                 effect = EffectFactory(name, name,
-                                       self._getEffectCategories(name),
-                                       self._getEffectName(element_factory),
-                                       self._getEffectDescripton(element_factory),
-                                       self._getEffectIcon(name))
+                                   self._getEffectCategories(name),
+                                   self._getEffectName(element_factory),
+                                   self._getEffectDescripton(element_factory),
+                                   self._getEffectIcon(name))
                 added = self.addStreams(element_factory, effect)
 
                 if added is True:
diff --git a/pitivi/factories/operation.py b/pitivi/factories/operation.py
index de4e82b..c5118bb 100644
--- a/pitivi/factories/operation.py
+++ b/pitivi/factories/operation.py
@@ -60,7 +60,8 @@ class EffectFactory (TransformFactory):
     """
     Factories that applies an effect on a stream
     """
-    def __init__ (self, effect, name='', categories=[_("Uncategorized")], human_name="", description="", icon=None):
+    def __init__ (self, effect, name='', categories=[_("Uncategorized")],
+                  human_name="", description="", icon=None):
         TransformFactory.__init__(self, name)
         self.effectname = effect
         self.categories = categories
@@ -83,7 +84,8 @@ class EffectFactory (TransformFactory):
         if isinstance(self.input_streams[0], VideoStream):
             csp = gst.element_factory_make("ffmpegcolorspace")
         else:
-            csp = gst.parse_bin_from_description("audioconvert ! audioresample", True)
+            csp = gst.parse_bin_from_description("audioconvert ! audioresample",
+                                                 True)
 
         bin.add(fx, csp)
         csp.link(fx)
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index a390e23..47ea1c5 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1702,6 +1702,8 @@ class Timeline(Signallable, Loggable):
         @raises TimelineError: if the factory doesn't have input or output streams
         @returns: A list of L{TimelineObject}, L{TrackObject} tuples
         """
+        #Note: We should maybe be able to handle several streams for effects which
+        #are actually working on audio/video streams
         self.debug("factory:%r", factory)
 
         output_stream = factory.getOutputStreams()
@@ -1718,7 +1720,6 @@ class Timeline(Signallable, Loggable):
         if track is None:
           raise TimelineError()
 
-        #try:
         listTimelineObjectTrackObject = []
         track_object = TrackEffect(factory, input_stream)
         track_object.makeBin()
diff --git a/pitivi/ui/gstwidget.py b/pitivi/ui/gstwidget.py
index a06bb00..dfd6673 100644
--- a/pitivi/ui/gstwidget.py
+++ b/pitivi/ui/gstwidget.py
@@ -75,7 +75,7 @@ def make_property_widget(unused_element, prop, value=None):
         elif type_name in ['gulong', 'guint64']:
             minimum, maximum = (0, 2**64 - 1)
             widget.set_increments(1.0, 10.0)
-        elif type_name == 'gfloat' or type_name == 'gdouble':
+        elif type_name in ['gfloat', 'gdouble']:
             minimum, maximum = (float("-Infinity"), float("Infinity"))
             widget.set_increments(0.00001, 0.01)
             widget.set_digits(5)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]