[pitivi] pep8: fix new pep8 errors



commit 0dad73ad44dd2f1d3b665e8277113e5fa3272fbd
Author: Lubosz Sarnecki <lubosz gmail com>
Date:   Tue Sep 16 21:02:28 2014 +0200

    pep8: fix new pep8 errors

 pitivi/clipproperties.py    |   14 +++++++-------
 pitivi/medialibrary.py      |   14 +++++++-------
 pitivi/preset.py            |    2 +-
 pitivi/project.py           |   22 +++++++++++-----------
 pitivi/timeline/ruler.py    |    8 ++++----
 pitivi/timeline/timeline.py |    2 +-
 pitivi/utils/ui.py          |    4 ++--
 pitivi/utils/widgets.py     |    4 ++--
 pitivi/viewer.py            |   18 +++++++++---------
 9 files changed, 44 insertions(+), 44 deletions(-)
---
diff --git a/pitivi/clipproperties.py b/pitivi/clipproperties.py
index fadfedd..6dfeab6 100644
--- a/pitivi/clipproperties.py
+++ b/pitivi/clipproperties.py
@@ -93,9 +93,9 @@ class ClipProperties(Gtk.ScrolledWindow, Loggable):
         vbox.pack_start(self.infobar_box, False, True, 0)
 
         # Transformation boxed DISABLED
-        #self.transformation_expander = TransformationProperties(instance, instance.action_log)
-        #self.transformation_expander.set_vexpand(False)
-        #vbox.pack_start(self.transformation_expander, False, True, 0)
+        # self.transformation_expander = TransformationProperties(instance, instance.action_log)
+        # self.transformation_expander.set_vexpand(False)
+        # vbox.pack_start(self.transformation_expander, False, True, 0)
 
         effects_properties_manager = EffectsPropertiesManager(app)
         self.effect_expander = EffectProperties(app, effects_properties_manager, self)
@@ -108,7 +108,7 @@ class ClipProperties(Gtk.ScrolledWindow, Loggable):
             self.effect_expander._connectTimelineSelection(self.app.gui.timeline_ui.timeline)
             # Transformation boxed DISABLED
             # if self.transformation_expander:
-                # self.transformation_expander.timeline = self.app.gui.timeline_ui.timeline
+            #     self.transformation_expander.timeline = self.app.gui.timeline_ui.timeline
 
     def _getProject(self):
         return self._project
@@ -334,7 +334,7 @@ class EffectProperties(Gtk.Expander, Loggable):
             track_type = track_element.get_track_type()
             if track_type == GES.TrackType.AUDIO and media_type == AUDIO_EFFECT or \
                     track_type == GES.TrackType.VIDEO and media_type == VIDEO_EFFECT:
-                    #Actually add the effect
+                    # Actually add the effect
                     self.app.action_log.begin("add effect")
                     effect = GES.Effect.new(bin_description=bin_desc)
                     clip.add(effect)
@@ -386,7 +386,7 @@ class EffectProperties(Gtk.Expander, Loggable):
             return False
 
         # FIXME GObject Introspection, make sure forth is the path
-        #view.set_tooltip_row(tooltip, path)
+        # view.set_tooltip_row(tooltip, path)
 
         return True
 
@@ -409,7 +409,7 @@ class EffectProperties(Gtk.Expander, Loggable):
 
         obj = self.clips[0]
         for effect in obj.get_top_effects():
-            if not effect.props.bin_description in HIDDEN_EFFECTS:
+            if effect.props.bin_description not in HIDDEN_EFFECTS:
                 asset = self.app.effects.getFactoryFromName(
                     effect.props.bin_description)
                 to_append = [effect.props.active]
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 1b0944c..81dc5e4 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -711,7 +711,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
                 # Can happen if the user removed the asset in the meanwhile.
                 self.log("%s needed a thumbnail, but vanished from storemodel", uri)
 
-    ## Error Dialog Box callbacks
+    # Error Dialog Box callbacks
 
     def _errorDialogBoxCloseCb(self, dialog):
         dialog.destroy()
@@ -719,7 +719,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
     def _errorDialogBoxResponseCb(self, dialog, unused_response):
         dialog.destroy()
 
-    ## Import Sources Dialog Box callbacks
+    # Import Sources Dialog Box callbacks
 
     def _dialogBoxResponseCb(self, dialogbox, response):
         self.debug("response: %r", response)
@@ -798,7 +798,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
                 else:
                     self.iconview.unselect_path(row.path)
 
-    ## UI callbacks
+    # UI callbacks
 
     def _removeClickedCb(self, unused_widget=None):
         """ Called when a user clicks on the remove button """
@@ -993,7 +993,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
                     iconview.select_path(current_cursor_pos)
 
     def _newProjectCreatedCb(self, unused_app, project):
-        if not self._project is project:
+        if self._project is not project:
             self._project = project
             self._resetErrorList()
             self.storemodel.clear()
@@ -1001,7 +1001,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
             self._connectToProject(project)
 
     def _newProjectLoadedCb(self, unused_app, project, unused_fully_ready):
-        if not self._project is project:
+        if self._project is not project:
             self._project = project
             self.storemodel.clear()
             self._connectToProject(project)
@@ -1021,7 +1021,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
             self.warning("Adding uris to project, but the project has changed in the meantime")
         return False
 
-    ## Drag and Drop
+    # Drag and Drop
     def _dndDataReceivedCb(self, unused_widget, unused_context, unused_x,
                            unused_y, selection, targettype, unused_time):
         self.debug("targettype: %d, selection.data: %r", targettype, selection.get_data())
@@ -1053,7 +1053,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
         if filenames:
             self.app.project_manager.current_project.addUris(filenames)
 
-    #used with TreeView and IconView
+    # Used with TreeView and IconView
     def _dndDragDataGetCb(self, unused_view, unused_context, data, unused_info, unused_timestamp):
         paths = self.getSelectedPaths()
         uris = [self.modelFilter[path][COL_URI] for path in paths]
diff --git a/pitivi/preset.py b/pitivi/preset.py
index e87f68e..8256d6f 100644
--- a/pitivi/preset.py
+++ b/pitivi/preset.py
@@ -205,7 +205,7 @@ class PresetManager(object):
         if preset is None:
             self.cur_preset = None
             return
-        elif not preset in self.presets:
+        elif preset not in self.presets:
             return
         values = self.presets[preset]
         self.cur_preset = preset
diff --git a/pitivi/project.py b/pitivi/project.py
index d9765e8..6ec3e5f 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -59,7 +59,7 @@ DEFAULT_MUXER = "oggmux"
 DEFAULT_VIDEO_ENCODER = "theoraenc"
 DEFAULT_AUDIO_ENCODER = "vorbisenc"
 
-#------------------ Backend classes ------------------------------------------#
+# ------------------ Backend classes ---------------------------------------- #
 
 
 class AssetRemovedAction(UndoableAction):
@@ -649,9 +649,9 @@ class Project(Loggable, GES.Project):
         self._acodecsettings_cache = {}
         self._has_rendering_values = False
 
-    #-----------------#
+    # --------------- #
     # Our properties  #
-    #-----------------#
+    # --------------- #
 
     # Project specific properties
     @property
@@ -849,9 +849,9 @@ class Project(Loggable, GES.Project):
         if value:
             return self.set_meta("render-scale", value)
 
-    #--------------------------------------------#
+    # ------------------------------------------ #
     # GES.Project virtual methods implementation #
-    #--------------------------------------------#
+    # ------------------------------------------ #
 
     def _handle_asset_loaded(self, asset=None, unused_asset_id=None):
         if asset and not GObject.type_is_a(asset.get_extractable_type(), GES.UriClip):
@@ -883,7 +883,7 @@ class Project(Loggable, GES.Project):
         """ vmethod, get called on "loaded" """
         self.loaded = True
         self._ensureTracks()
-        #self._ensureLayer()
+        # self._ensureLayer()
 
         encoders = CachedEncoderList()
         # The project just loaded, we need to check the new
@@ -913,9 +913,9 @@ class Project(Loggable, GES.Project):
                 else:
                     self.warning("We do not handle profile: %s" % profile)
 
-    #--------------------------------------------#
+    # ------------------------------------------ #
     #               Our API                      #
-    #--------------------------------------------#
+    # ------------------------------------------ #
 
     def createTimeline(self):
         """
@@ -1061,9 +1061,9 @@ class Project(Loggable, GES.Project):
     def acodecsettings(self, value):
         self._acodecsettings_cache[self.aencoder] = value
 
-    #--------------------------------------------#
+    # ------------------------------------------ #
     #               Private methods              #
-    #--------------------------------------------#
+    # ------------------------------------------ #
 
     def _ensureTracks(self):
         if self.timeline is None:
@@ -1131,7 +1131,7 @@ class Project(Loggable, GES.Project):
         self.nb_remaining_file_to_import = nb_remaining_file_to_import
 
 
-#----------------------- UI classes ------------------------------------------#
+# ---------------------- UI classes ----------------------------------------- #
 class ProjectSettingsDialog():
 
     def __init__(self, parent_window, project):
diff --git a/pitivi/timeline/ruler.py b/pitivi/timeline/ruler.py
index 5db31e3..c07cf73 100644
--- a/pitivi/timeline/ruler.py
+++ b/pitivi/timeline/ruler.py
@@ -137,7 +137,7 @@ class ScaleRuler(Gtk.DrawingArea, Zoomable, Loggable):
             GLib.source_remove(self.callback_id_scroll)
         self.callback_id_scroll = GLib.timeout_add(100, self._maybeUpdate)
 
-## Zoomable interface override
+# Zoomable interface override
 
     def _maybeUpdate(self):
         self.queue_draw()
@@ -150,7 +150,7 @@ class ScaleRuler(Gtk.DrawingArea, Zoomable, Loggable):
             GLib.source_remove(self.callback_id)
         self.callback_id = GLib.timeout_add(100, self._maybeUpdate)
 
-## timeline position changed method
+# Timeline position changed method
 
     def setPipeline(self, pipeline):
         pipeline.connect('position', self.timelinePositionCb)
@@ -159,7 +159,7 @@ class ScaleRuler(Gtk.DrawingArea, Zoomable, Loggable):
         self.position = position
         self.queue_draw()
 
-## Gtk.Widget overrides
+# Gtk.Widget overrides
     def configureEventCb(self, widget, unused_event, unused_data=None):
         width = widget.get_allocated_width()
         height = widget.get_allocated_height()
@@ -244,7 +244,7 @@ class ScaleRuler(Gtk.DrawingArea, Zoomable, Loggable):
         self.ns_per_frame = float(1 / self.frame_rate) * Gst.SECOND
         self.scales = (float(2 / rate), float(5 / rate), float(10 / rate)) + SCALES
 
-## Drawing methods
+# Drawing methods
 
     def drawBackground(self, context):
         style = self.get_style_context()
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index b7d8b31..c211b1c 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1128,7 +1128,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
         if self.bTimeline:
             self.app.action_log.begin("delete clip")
 
-            #FIXME GES port: Handle unlocked TrackElement-s
+            # FIXME GES port: Handle unlocked TrackElement-s
             for clip in self.timeline.selection:
                 layer = clip.get_layer()
                 layer.remove_clip(clip)
diff --git a/pitivi/utils/ui.py b/pitivi/utils/ui.py
index 9074d8c..60b38d5 100644
--- a/pitivi/utils/ui.py
+++ b/pitivi/utils/ui.py
@@ -379,7 +379,7 @@ def beautify_ETA(length):
     return ", ".join(parts)
 
 
-#--------------------- Gtk widget helpers ------------------------------------#
+# -------------------- Gtk widget helpers ----------------------------------- #
 def model(columns, data):
     ret = Gtk.ListStore(*columns)
     for datum in data:
@@ -423,7 +423,7 @@ def alter_style_class(style_class, target_widget, css_style):
     style_context.add_provider(css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
 
 
-#------------------------ encoding datas ----------------------------------------#
+# ----------------------- encoding datas --------------------------------------- #
 # FIXME This should into a special file
 frame_rates = model((str, object), (
     # Translators: fps is for frames per second
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index e499fe5..9c6616f 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -632,9 +632,9 @@ class GstElementSettingsWidget(Gtk.VBox, Loggable):
         is_effect = False
         if isinstance(self.element, GES.Effect):
             is_effect = True
-            props = [prop for prop in self.element.list_children_properties() if not prop.name in 
self.ignore]
+            props = [prop for prop in self.element.list_children_properties() if prop.name not in 
self.ignore]
         else:
-            props = [prop for prop in GObject.list_properties(self.element) if not prop.name in self.ignore]
+            props = [prop for prop in GObject.list_properties(self.element) if prop.name not in self.ignore]
         if not props:
             table = Gtk.Table(n_rows=1, n_columns=1)
             widget = Gtk.Label(label=_("No properties."))
diff --git a/pitivi/viewer.py b/pitivi/viewer.py
index cf50299..405ee39 100644
--- a/pitivi/viewer.py
+++ b/pitivi/viewer.py
@@ -282,14 +282,14 @@ class ViewerContainer(Gtk.VBox, Loggable):
         nanoseconds = self.timecode_entry.getWidgetValue()
         self.seeker.seek(nanoseconds)
 
-    ## active Timeline calllbacks
+    # Active Timeline calllbacks
     def _durationChangedCb(self, unused_pipeline, duration):
         if duration == 0:
             self._setUiActive(False)
         else:
             self._setUiActive(True)
 
-    ## Control Gtk.Button callbacks
+    # Control Gtk.Button callbacks
 
     def setZoom(self, zoom):
         """
@@ -331,7 +331,7 @@ class ViewerContainer(Gtk.VBox, Loggable):
         self.seeker.seek(end)
         self.app.gui.focusTimeline()
 
-    ## public methods for controlling playback
+    # Public methods for controlling playback
 
     def undock(self, *unused_widget):
         if not self.docked:
@@ -614,12 +614,12 @@ class TransformationBox():
         self.last_y = event.y
 
     def init_points(self):
-        #corner boxes
+        # Corner boxes
         self.points[TOP_LEFT] = Point(self.left, self.top, self.settings)
         self.points[TOP_RIGHT] = Point(self.right, self.top, self.settings)
         self.points[BOTTOM_LEFT] = Point(self.left, self.bottom, self.settings)
         self.points[BOTTOM_RIGHT] = Point(self.right, self.bottom, self.settings)
-        #edge boxes
+        # Edge boxes
         self.points[TOP] = Point(self.center.x, self.top, self.settings)
         self.points[BOTTOM] = Point(self.center.x, self.bottom, self.settings)
         self.points[LEFT] = Point(self.left, self.center.y, self.settings)
@@ -628,12 +628,12 @@ class TransformationBox():
     def update_points(self):
         self._update_measure()
 
-        #corner boxes
+        # Corner boxes
         self.points[TOP_LEFT].set_position(self.left, self.top)
         self.points[TOP_RIGHT].set_position(self.right, self.top)
         self.points[BOTTOM_LEFT].set_position(self.left, self.bottom)
         self.points[BOTTOM_RIGHT].set_position(self.right, self.bottom)
-        #edge boxes
+        # Edge boxes
         self.points[TOP].set_position(self.center.x, self.top)
         self.points[BOTTOM].set_position(self.center.x, self.bottom)
         self.points[LEFT].set_position(self.left, self.center.y)
@@ -825,8 +825,8 @@ class ViewerWidget(Gtk.AspectFrame, Loggable):
         self.pipeline = None
         self.transformation_properties = None
         # FIXME PyGi Styling with Gtk3
-        #for state in range(Gtk.StateType.INSENSITIVE + 1):
-            #self.modify_bg(state, self.style.black)
+        # for state in range(Gtk.StateType.INSENSITIVE + 1):
+        #    self.modify_bg(state, self.style.black)
 
     def setDisplayAspectRatio(self, ratio):
         self.set_property("ratio", float(ratio))


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