From 2dd13f3fa0ed33cba0ae12369bf470d1179a3573 Mon Sep 17 00:00:00 2001 From: Duncan Lock Date: Sun, 23 Jun 2013 11:04:46 -0700 Subject: [PATCH] Made read_minutes 1 minute min --- post_stats/post_stats.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/post_stats/post_stats.py b/post_stats/post_stats.py index f8a91f2..8270dfb 100644 --- a/post_stats/post_stats.py +++ b/post_stats/post_stats.py @@ -68,6 +68,8 @@ def calculate_stats(instance): stats['wc'] = sum(word_count.values()) # stats['read_minutes'] = math.ceil(float(stats['wc']) / float(WPM)) stats['read_minutes'] = (stats['wc'] + WPM - 1) // WPM + if stats['read_minutes'] == 0: + stats['read_minutes'] = 1 instance.stats = stats instance.raw_text = raw_text