Skip to content

Commit 598c4f0

Browse files
jonoomphferdnyc
andauthored
Apply suggestions from code review
Co-authored-by: Frank Dana <[email protected]>
1 parent d143721 commit 598c4f0

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

installer/launch-linux.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
# Add the current folder the library path
4-
HERE="$(dirname "$(readlink -f "${0}")")"
4+
HERE=$(dirname "$(realpath "$0")")
55
export LD_LIBRARY_PATH="${HERE}"
66

77
# Set some environment variables

src/windows/views/timeline_webview.py

+14-5
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,8 @@ def Slice_Triggered(self, action, clip_ids, trans_ids, playhead_position=0):
19311931
self.waveform_cache[right_clip.id] = self.waveform_cache.get(clip_id, '[]')
19321932

19331933
# Pass audio to javascript timeline (and render)
1934-
self.run_js(JS_SCOPE_SELECTOR + ".setAudioData('{}',{});".format(right_clip.id, self.waveform_cache.get(right_clip.id)))
1934+
self.run_js(JS_SCOPE_SELECTOR + ".setAudioData('{}',{});"
1935+
.format(right_clip.id, self.waveform_cache.get(right_clip.id)))
19351936

19361937
# Save changes
19371938
self.update_clip_data(clip.data, only_basic_props=False, ignore_reader=True)
@@ -2883,7 +2884,8 @@ def callback(self, data, callback_data):
28832884
self.run_js(JS_SCOPE_SELECTOR + ".startManualMove('{}', '{}');".format(self.item_type, self.item_id))
28842885

28852886
# Find position from javascript
2886-
self.run_js(JS_SCOPE_SELECTOR + ".getJavaScriptPosition({}, {});".format(event_position.x(), event_position.y()), partial(callback, self, data))
2887+
self.run_js(JS_SCOPE_SELECTOR + ".getJavaScriptPosition({}, {});"
2888+
.format(event_position.x(), event_position.y()), partial(callback, self, data))
28872889

28882890
# Resize timeline
28892891
@pyqtSlot(float)
@@ -2936,7 +2938,9 @@ def callback(self, file_ids, callback_data):
29362938
self.run_js(JS_SCOPE_SELECTOR + ".startManualMove('{}','{}');".format(self.item_type, self.item_id))
29372939

29382940
# Find position from javascript
2939-
self.run_js(JS_SCOPE_SELECTOR + ".getJavaScriptPosition({}, {});".format(event_position.x(), event_position.y()), partial(callback, self, file_ids))
2941+
self.run_js(JS_SCOPE_SELECTOR + ".getJavaScriptPosition({}, {});"
2942+
.format(event_position.x(), event_position.y()),
2943+
partial(callback, self, file_ids))
29402944

29412945
# Add Effect
29422946
def addEffect(self, effect_names, event_position):
@@ -2952,7 +2956,11 @@ def callback(self, effect_names, callback_data):
29522956
# Loop through clips on the closest layer
29532957
possible_clips = Clip.filter(layer=js_nearest_track)
29542958
for clip in possible_clips:
2955-
if js_position == 0 or (clip.data["position"] <= js_position <= clip.data["position"] + (clip.data["end"] - clip.data["start"])):
2959+
if js_position == 0 or (
2960+
clip.data["position"]
2961+
<= js_position
2962+
<= clip.data["position"] + (clip.data["end"] - clip.data["start"])
2963+
):
29562964
log.info("Applying effect to clip")
29572965
log.info(clip)
29582966

@@ -2970,7 +2978,8 @@ def callback(self, effect_names, callback_data):
29702978
self.update_clip_data(clip.data, only_basic_props=False, ignore_reader=True)
29712979

29722980
# Find position from javascript
2973-
self.run_js(JS_SCOPE_SELECTOR + ".getJavaScriptPosition({}, {});".format(event_position.x(), event_position.y()), partial(callback, self, effect_names))
2981+
self.run_js(JS_SCOPE_SELECTOR + ".getJavaScriptPosition({}, {});"
2982+
.format(event_position.x(), event_position.y()), partial(callback, self, effect_names))
29742983

29752984
# Without defining this method, the 'copy' action doesn't show with cursor
29762985
def dragMoveEvent(self, event):

0 commit comments

Comments
 (0)