From 42f76d47ad90b79515131f19b135ae3aaa93a756 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sat, 26 Mar 2011 14:37:48 -0400 Subject: [PATCH] Fix bug #743178: Allow BasicNewsRecipe.delay to be a float and clarify docs. --- src/calibre/web/feeds/news.py | 3 ++- src/calibre/web/fetch/simple.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index f2aeb4e4bd..325fcf5209 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -71,7 +71,8 @@ class BasicNewsRecipe(Recipe): #: Number of levels of links to follow on article webpages recursions = 0 - #: Delay between consecutive downloads in seconds + #: Delay between consecutive downloads in seconds. The argument may be a + #: floating point number to indicate a more precise time. delay = 0 #: Publication type diff --git a/src/calibre/web/fetch/simple.py b/src/calibre/web/fetch/simple.py index 64a2c32fb3..5a76c4fa2e 100644 --- a/src/calibre/web/fetch/simple.py +++ b/src/calibre/web/fetch/simple.py @@ -486,7 +486,7 @@ def option_parser(usage=_('%prog URL\n\nWhere URL is for example http://google.c type='int', dest='max_recursions') parser.add_option('-n', '--max-files', default=sys.maxint, type='int', dest='max_files', help=_('The maximum number of files to download. This only applies to files from tags. Default is %default')) - parser.add_option('--delay', default=0, dest='delay', type='int', + parser.add_option('--delay', default=0, dest='delay', type='float', help=_('Minimum interval in seconds between consecutive fetches. Default is %default s')) parser.add_option('--encoding', default=None, help=_('The character encoding for the websites you are trying to download. The default is to try and guess the encoding.'))