[pitivi] timeline: Reindent some code



commit fa8808fefd2106e24e3d26322dcdd6bd720f04d3
Author: Thibault Saunier <tsaunier gnome org>
Date:   Wed Jan 6 14:30:32 2016 +0100

    timeline: Reindent some code
    
    Making it simpler to read
    
    Reviewed-by: Alex Băluț <alexandru balut gmail com>
    Differential Revision: https://phabricator.freedesktop.org/D623

 pitivi/timeline/timeline.py |   62 +++++++++++++++++++++++--------------------
 1 files changed, 33 insertions(+), 29 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 8946cf9..359eedc 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1551,44 +1551,48 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
             self.timeline.selection.setSelection([], SELECT)
 
     def _ungroupSelected(self, unused_action, unused_parameter):
-        if self.bTimeline:
-            self.app.action_log.begin("ungroup")
+        if not self.bTimeline:
+            self.info("No bTimeline set yet!")
+            return
 
-            for obj in self.timeline.selection:
-                toplevel = obj.get_toplevel_parent()
-                if toplevel == self.timeline.current_group:
-                    for child in toplevel.get_children(False):
-                        child.ungroup(False)
-                else:
-                    toplevel.ungroup(False)
+        self.app.action_log.begin("ungroup")
 
-            self.timeline.resetSelectionGroup()
+        for obj in self.timeline.selection:
+            toplevel = obj.get_toplevel_parent()
+            if toplevel == self.timeline.current_group:
+                for child in toplevel.get_children(False):
+                    child.ungroup(False)
+            else:
+                toplevel.ungroup(False)
 
-            self.app.action_log.commit()
-            self._project.pipeline.commit_timeline()
+        self.timeline.resetSelectionGroup()
 
-    def _groupSelected(self, unused_action, unused_parameter):
-        if self.bTimeline:
-            self.app.action_log.begin("group")
+        self.app.action_log.commit()
+        self._project.pipeline.commit_timeline()
 
-            containers = set({})
+    def _groupSelected(self, unused_action, unused_parameter):
+        if not self.bTimeline:
+            self.error("No timeline set yet?")
+            return
 
-            for obj in self.timeline.selection:
-                toplevel = obj.get_toplevel_parent()
-                if toplevel == self.timeline.current_group:
-                    for child in toplevel.get_children(False):
-                        containers.add(child)
-                    toplevel.ungroup(False)
-                else:
-                    containers.add(toplevel)
+        self.app.action_log.begin("group")
+        containers = set({})
+        for obj in self.timeline.selection:
+            toplevel = obj.get_toplevel_parent()
+            if toplevel == self.timeline.current_group:
+                for child in toplevel.get_children(False):
+                    containers.add(child)
+                toplevel.ungroup(False)
+            else:
+                containers.add(toplevel)
 
-            if containers:
-                GES.Container.group(list(containers))
+        if containers:
+            GES.Container.group(list(containers))
 
-            self.timeline.resetSelectionGroup()
+        self.timeline.resetSelectionGroup()
 
-            self._project.pipeline.commit_timeline()
-            self.app.action_log.commit()
+        self._project.pipeline.commit_timeline()
+        self.app.action_log.commit()
 
     def __copyClipsCb(self, unused_action, unused_parameter):
         if self.timeline.current_group:


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