From 8f057ac0bd638f1f3a422da36befcd23da383423 Mon Sep 17 00:00:00 2001 From: fnord Date: Fri, 17 Jul 2015 03:05:24 -0500 Subject: [PATCH] dfxp: fix syntax --- youtube_dl/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 5a9c1ea3a..05d1f82f3 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1850,12 +1850,10 @@ def dfxp2srt(dfxp_data): 'ttaf1': 'http://www.w3.org/2006/10/ttaf1', }) - def text_or_empty(v): """ return string that contains something other than whitespace, or '' """ str = str_or_none(v, '') - return '' if not re.search(r'[^\s]',str,re.DOTALL) else str - + return '' if not re.search(r'[^\s]', str, re.DOTALL) else str def parse_node(node): str_or_empty = functools.partial(str_or_none, default='') @@ -1872,7 +1870,7 @@ def dfxp2srt(dfxp_data): return out - dfxp = xml.etree.ElementTree.fromstring(dfxp_data.replace('\n','').encode('utf-8')) + dfxp = xml.etree.ElementTree.fromstring(dfxp_data.replace('\n', '').encode('utf-8')) out = [] paras = dfxp.findall(_x('.//ttml:p')) or dfxp.findall(_x('.//ttaf1:p')) or dfxp.findall('.//p')