changeset 25:35a52998884f

added more warnings
author Atul Varma <varmaa@toolness.com>
date Sun, 03 Jan 2010 06:33:50 -0800
parents 2b4cf6903012
children 197980874dd4
files publish_edition.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/publish_edition.py	Sun Jan 03 06:19:59 2010 -0800
+++ b/publish_edition.py	Sun Jan 03 06:33:50 2010 -0800
@@ -107,7 +107,8 @@
         for article in potential_articles:
             html = [ctype['value']
                     for ctype in article['content']
-                    if ctype.get('type') == 'text/html']
+                    if ctype.get('type') == 'text/html'
+                    and ctype.get('value')]
             if not html:
                 logging.warn('no html content for %s.' % article['url'])
             elif len(html) > 1:
@@ -118,6 +119,13 @@
                     if author not in filtered_articles:
                         filtered_articles[author] = []
                     filtered_articles[author].append(article)
+                elif word_count > max_word_count:
+                    logging.warn(
+                        'article will never be included in an '
+                        'issue due to word count: %s (%d words)' % (
+                            article['url'],
+                            word_count
+                            ))
                 words_left -= word_count
                 articles_left -= 1
                 if not articles_left: