Skip to content

Commit

Permalink
Removing extra parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
remia committed Sep 10, 2020
1 parent 484c505 commit 3ac06ba
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions clairmeta/dcp_check_subtitle.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,21 @@ def get_font_path(self, xml_dict, folder):

return path, uri

def extract_subtitle_text(self, node, out_text):
def extract_subtitle_text(self, node):
text = []

if isinstance(node, list):
for elem in node:
text += self.extract_subtitle_text(elem, [])
text += self.extract_subtitle_text(elem)
elif isinstance(node, dict):
if 'Font' in node:
text += self.extract_subtitle_text(node['Font'], [])
text = self.extract_subtitle_text(node['Font'])
if 'Text' in node:
text += self.extract_subtitle_text(node['Text'], [])
text = self.extract_subtitle_text(node['Text'])
else:
text += [node]
text = [node]

return out_text + text
return text


class Checker(CheckerBase):
Expand Down Expand Up @@ -430,7 +430,7 @@ def check_subtitle_cpl_font_glyph(self, playlist, asset, folder):
# Subtitle Text and Font hierarchy. Note that here we just
# recursively iterate to extract all relevant childs whitout
# checking if the specific hierarchy is valid or not.
all_text = self.st_util.extract_subtitle_text(subtitles[0], [])
all_text = self.st_util.extract_subtitle_text(subtitles[0])
unique_chars = set()
for text in all_text:
for char in text:
Expand Down

0 comments on commit 3ac06ba

Please sign in to comment.