[pitivi] Fix pylint consider-merging-isinstance
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Fix pylint consider-merging-isinstance
- Date: Mon, 11 Nov 2019 22:05:24 +0000 (UTC)
commit c7cb01659c2cbbce5855f23a765cfd8242edaa68
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Sun Oct 27 06:30:16 2019 +0100
Fix pylint consider-merging-isinstance
pitivi/timeline/elements.py | 3 +--
pitivi/titleeditor.py | 3 +--
pitivi/undo/timeline.py | 6 ++----
pitivi/utils/timeline.py | 3 +--
4 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index d76df148..0044eb92 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -1274,8 +1274,7 @@ class Clip(Gtk.EventBox, Zoomable, Loggable):
selection = [self.ges_clip]
else:
selection = [elem for elem in parent.get_children(True)
- if isinstance(elem, GES.SourceClip) or
- isinstance(elem, GES.TransitionClip)]
+ if isinstance(elem, (GES.SourceClip, GES.TransitionClip))]
self.timeline.selection.setSelection(selection, mode)
return False
diff --git a/pitivi/titleeditor.py b/pitivi/titleeditor.py
index 871de9e0..7565840a 100644
--- a/pitivi/titleeditor.py
+++ b/pitivi/titleeditor.py
@@ -231,8 +231,7 @@ class TitleEditor(Loggable):
self._children_props_handler = None
self.source = None
if source:
- assert isinstance(source, GES.TextOverlay) or \
- isinstance(source, GES.TitleSource)
+ assert isinstance(source, (GES.TextOverlay, GES.TitleSource))
self._updateFromSource(source)
self.source = source
self.infobar.hide()
diff --git a/pitivi/undo/timeline.py b/pitivi/undo/timeline.py
index 191d4d42..ed60d658 100644
--- a/pitivi/undo/timeline.py
+++ b/pitivi/undo/timeline.py
@@ -72,8 +72,7 @@ class TrackElementPropertyChanged(UndoableAction):
st['element-name'] = self.track_element.get_name()
st['property'] = self.property_name
value = self.new_value
- if isinstance(self.new_value, GObject.GFlags) or\
- isinstance(self.new_value, GObject.GEnum):
+ if isinstance(self.new_value, (GObject.GEnum, GObject.GFlags)):
value = int(self.new_value)
_, _, pspec = self.track_element.lookup_child(self.property_name)
@@ -730,8 +729,7 @@ class LayerObserver(MetaContainerObserver, Loggable):
self._control_binding_added_cb)
track_element.connect("control-binding-removed",
self._control_binding_removed_cb)
- if isinstance(track_element, GES.BaseEffect) or \
- isinstance(track_element, GES.VideoSource):
+ if isinstance(track_element, (GES.BaseEffect, GES.VideoSource)):
observer = TrackElementObserver(track_element, self.action_log)
self.track_element_observers[track_element] = observer
diff --git a/pitivi/utils/timeline.py b/pitivi/utils/timeline.py
index 58bfffd7..cd3bf525 100644
--- a/pitivi/utils/timeline.py
+++ b/pitivi/utils/timeline.py
@@ -132,8 +132,7 @@ class Selection(GObject.Object, Loggable):
from pitivi.utils.ui import unset_children_state_recurse
unset_children_state_recurse(obj.ui, Gtk.StateFlags.SELECTED)
for element in obj.get_children(False):
- if isinstance(obj, GES.BaseEffect) or\
- isinstance(obj, GES.TextOverlay):
+ if isinstance(obj, (GES.BaseEffect, GES.TextOverlay)):
continue
element.selected.selected = selected
self.set_can_group_ungroup()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]