From: Leandro Lucarella Date: Sat, 14 Jul 2012 18:09:47 +0000 (+0200) Subject: Reduce indentation by returning ASAP X-Git-Url: https://git.llucax.com/software/subdivxget.git/commitdiff_plain/44c70b16fa26aad38244f816c2b0ad3c3a170ecc?ds=inline Reduce indentation by returning ASAP --- diff --git a/subdivxget b/subdivxget index 5f67edb..1aecc66 100755 --- a/subdivxget +++ b/subdivxget @@ -72,18 +72,19 @@ class SubDivXHTMLParser(HTMLParser.HTMLParser): self.parsing = False def handle_data(self, data): - if self.parsing: - data = data.strip() - if self.attr is not None and data: - self.cur[self.attr] = data - self.attr = None - elif data in ('Downloads:', 'Cds:', 'Comentarios:', - 'Formato:'): - self.attr = data[:-1].lower() - elif data == 'Subido por:': - self.attr = 'autor' - elif data == 'el': - self.attr = 'fecha' + if not self.parsing: + return + data = data.strip() + if self.attr is not None and data: + self.cur[self.attr] = data + self.attr = None + elif data in ('Downloads:', 'Cds:', 'Comentarios:', + 'Formato:'): + self.attr = data[:-1].lower() + elif data == 'Subido por:': + self.attr = 'autor' + elif data == 'el': + self.attr = 'fecha' def subdivx_get_subs(query_str):