From 30775d7c8897c35161b354c16c9d7559a4f400ad Mon Sep 17 00:00:00 2001 From: Breakthrough Date: Fri, 30 Aug 2019 20:05:20 -0400 Subject: [PATCH] Clean up PyLint warnings. --- scenedetect/detectors/content_detector.py | 6 +++--- scenedetect/scene_manager.py | 16 ++++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/scenedetect/detectors/content_detector.py b/scenedetect/detectors/content_detector.py index b4e4fc82..6df9abe4 100644 --- a/scenedetect/detectors/content_detector.py +++ b/scenedetect/detectors/content_detector.py @@ -123,9 +123,9 @@ def process_frame(self, frame_num, frame_img): # We consider any frame over the threshold a new scene, but only if # the minimum scene length has been reached (otherwise it is ignored). if delta_hsv_avg >= self.threshold and ( - (frame_num - self.last_scene_cut) >= self.min_scene_len): - cut_list.append(frame_num) - self.last_scene_cut = frame_num + (frame_num - self.last_scene_cut) >= self.min_scene_len): + cut_list.append(frame_num) + self.last_scene_cut = frame_num if self.last_frame is not None and self.last_frame is not _unused: del self.last_frame diff --git a/scenedetect/scene_manager.py b/scenedetect/scene_manager.py index 9eafbedb..e41bf47d 100644 --- a/scenedetect/scene_manager.py +++ b/scenedetect/scene_manager.py @@ -140,8 +140,9 @@ def write_scene_list(output_csv_file, scene_list, cut_list=None): '%d' % duration.get_frames(), duration.get_timecode(), '%.3f' % duration.get_seconds()]) -def write_scene_list_html(output_html_filename, scene_list, cut_list=None, css=None, css_class='mytable', - image_filenames=None, image_width=None, image_height=None): +def write_scene_list_html(output_html_filename, scene_list, cut_list=None, css=None, + css_class='mytable', image_filenames=None, image_width=None, + image_height=None): """Writes the given list of scenes to an output file handle in html format. Arguments: @@ -198,12 +199,14 @@ def write_scene_list_html(output_html_filename, scene_list, cut_list=None, css=N # Output Timecode list timecode_table = SimpleTable([["Timecode List:"] + - (cut_list if cut_list else [start.get_timecode() for start, _ in scene_list[1:]])], + (cut_list if cut_list else + [start.get_timecode() for start, _ in scene_list[1:]])], css_class=css_class) # Output list of scenes - header_row = ["Scene Number", "Start Frame", "Start Timecode", "Start Time (seconds)","End Frame", - "End Timecode", "End Time (seconds)", "Length (frames)", "Length (timecode)", "Length (seconds)"] + header_row = ["Scene Number", "Start Frame", "Start Timecode", "Start Time (seconds)", + "End Frame", "End Timecode", "End Time (seconds)", + "Length (frames)", "Length (timecode)", "Length (seconds)"] for i, (start, end) in enumerate(scene_list): duration = end - start @@ -215,7 +218,8 @@ def write_scene_list_html(output_html_filename, scene_list, cut_list=None, css=N if image_filenames: for image in image_filenames[i]: - row.add_cell(SimpleTableCell(SimpleTableImage(image, width=image_width, height=image_height))) + row.add_cell(SimpleTableCell(SimpleTableImage( + image, width=image_width, height=image_height))) if i == 0: scene_table = SimpleTable(rows=[row], header_row=header_row, css_class=css_class)