Skip to content

Commit

Permalink
Clean up PyLint warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Breakthrough committed Aug 31, 2019
1 parent d8cd4f8 commit 30775d7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
6 changes: 3 additions & 3 deletions scenedetect/detectors/content_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions scenedetect/scene_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit 30775d7

Please sign in to comment.