Skip to content

Commit 0166bb0

Browse files
committed
Linter fixes
1 parent ad1df9e commit 0166bb0

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

src/windows/views/properties_tableview.py

+18-13
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,16 @@
4242

4343
import openshot
4444

45+
4546
class PropertyDelegate(QItemDelegate):
4647
def __init__(self, parent=None, *args):
4748
QItemDelegate.__init__(self, parent, *args)
4849

4950
# pixmaps for curve icons
50-
self.curve_pixmaps = { openshot.BEZIER: QPixmap(os.path.join(info.IMAGES_PATH, "keyframe-%s.png" % openshot.BEZIER)),
51-
openshot.LINEAR: QPixmap(os.path.join(info.IMAGES_PATH, "keyframe-%s.png" % openshot.LINEAR)),
52-
openshot.CONSTANT: QPixmap(os.path.join(info.IMAGES_PATH, "keyframe-%s.png" % openshot.CONSTANT))
53-
}
51+
self.curve_pixmaps = {openshot.BEZIER: QPixmap(os.path.join(info.IMAGES_PATH, "keyframe-%s.png" % openshot.BEZIER)),
52+
openshot.LINEAR: QPixmap(os.path.join(info.IMAGES_PATH, "keyframe-%s.png" % openshot.LINEAR)),
53+
openshot.CONSTANT: QPixmap(os.path.join(info.IMAGES_PATH, "keyframe-%s.png" % openshot.CONSTANT))
54+
}
5455

5556
def paint(self, painter, option, index):
5657
painter.save()
@@ -125,9 +126,9 @@ def paint(self, painter, option, index):
125126
painter.setBrush(gradient)
126127
path = QPainterPath()
127128
value_rect = QRectF(option.rect)
128-
path.addRoundedRect(value_rect, 15, 15);
129+
path.addRoundedRect(value_rect, 15, 15)
129130
painter.fillPath(path, gradient)
130-
painter.drawPath(path);
131+
painter.drawPath(path)
131132
painter.setClipping(False)
132133

133134
if points > 1:
@@ -406,7 +407,11 @@ def contextMenuEvent(self, event=None, release=False):
406407
fileParentPath = self.files_model.model.item(fileItem.row(), 4).text()
407408

408409
# Append file choice
409-
file_choices.append({"name": fileName, "value": os.path.join(fileParentPath, fileName), "selected": False, "icon": fileIcon })
410+
file_choices.append({"name": fileName,
411+
"value": os.path.join(fileParentPath, fileName),
412+
"selected": False,
413+
"icon": fileIcon
414+
})
410415

411416
# Add root file choice
412417
self.choices.append({"name": _("Files"), "value": file_choices, "selected": False})
@@ -421,20 +426,20 @@ def contextMenuEvent(self, event=None, release=False):
421426
transPath = self.transition_model.model.item(transItem.row(), 3).text()
422427

423428
# Append transition choice
424-
trans_choices.append({"name": transName, "value": transPath, "selected": False, "icon": transIcon })
429+
trans_choices.append({"name": transName, "value": transPath, "selected": False, "icon": transIcon})
425430

426431
# Add root transitions choice
427432
self.choices.append({"name": _("Transitions"), "value": trans_choices, "selected": False})
428433

429434
# Handle reader type values
430-
if property_name =="Track" and self.property_type == "int" and not self.choices:
435+
if property_name == "Track" and self.property_type == "int" and not self.choices:
431436
# Populate all display track names
432437
all_tracks = get_app().project.get("layers")
433438
display_count = len(all_tracks)
434439
for track in reversed(sorted(all_tracks, key=itemgetter('number'))):
435440
# Append track choice
436441
track_name = track.get("label") or _("Track %s") % display_count
437-
self.choices.append({"name": track_name, "value": track.get("number"), "selected": False })
442+
self.choices.append({"name": track_name, "value": track.get("number"), "selected": False})
438443
display_count -= 1
439444

440445
# Define bezier presets
@@ -680,7 +685,7 @@ def getMenu(self):
680685
item_icon = QIcon(QPixmap(clip.data.get('image')))
681686
action = menu.addAction(item_name)
682687
action.setIcon(item_icon)
683-
action.setData({'item_id':item_id, 'item_type':'clip'})
688+
action.setData({'item_id': item_id, 'item_type': 'clip'})
684689
action.triggered.connect(self.Action_Triggered)
685690

686691
# Add effects for these clips (if any)
@@ -699,7 +704,7 @@ def getMenu(self):
699704
trans = Transition.get(id=item_id)
700705
if trans:
701706
item_name = _(trans.title())
702-
item_icon = QIcon(QPixmap(trans.data.get('reader',{}).get('path')))
707+
item_icon = QIcon(QPixmap(trans.data.get('reader', {}).get('path')))
703708
action = menu.addAction(_(item_name))
704709
action.setIcon(item_icon)
705710
action.setData({'item_id': item_id, 'item_type': 'transition'})
@@ -793,7 +798,7 @@ def __init__(self, *args):
793798
self.lblSelection.setTextFormat(Qt.RichText)
794799

795800
hbox = QHBoxLayout()
796-
hbox.setContentsMargins(0,0,0,0)
801+
hbox.setContentsMargins(0, 0, 0, 0)
797802
hbox.addWidget(self.lblSelection)
798803
hbox.addWidget(self.btnSelectionName)
799804
self.setLayout(hbox)

0 commit comments

Comments
 (0)