]> git.phdru.name Git - bookmarks_db.git/commitdiff
Combined two "if"s.
authorOleg Broytman <phd@phdru.name>
Sun, 24 Feb 2008 21:19:19 +0000 (21:19 +0000)
committerOleg Broytman <phd@phdru.name>
Sun, 24 Feb 2008 21:19:19 +0000 (21:19 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@183 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Robots/parse_html.py

index 137ebfad9809d369712483bfa63b97744f7c6f1a..57f64985a58d5a096bc604acc37f2dbb9975a70b 100755 (executable)
@@ -32,9 +32,9 @@ num_entity_re = re.compile("(&#[0-9]+;)")
 def recode_entities(title, charset):
    output = []
    for part in entity_re.split(title):
-      if entity_re.match(part):
-         if part not in ("&amp;", "&lt;", "&gt;", "&quote;", "&nbsp;"):
-            part = entitydefs.get(part[1:-1], part)
+      if part not in ("&amp;", "&lt;", "&gt;", "&quote;", "&nbsp;") and \
+            entity_re.match(part):
+         part = entitydefs.get(part[1:-1], part)
       output.append(part)
 
    output2 = []