Fixed bug with config feed_timeouts not being ints.
This commit is contained in:
parent
6cc797ce0a
commit
45eda384cb
@ -70,6 +70,11 @@ def __init__():
|
|||||||
setattr(config, name, lambda default=default: get(None,name,default))
|
setattr(config, name, lambda default=default: get(None,name,default))
|
||||||
planet_predefined_options.append(name)
|
planet_predefined_options.append(name)
|
||||||
|
|
||||||
|
# define a list planet-level variable
|
||||||
|
def define_planet_int(name, default=0):
|
||||||
|
setattr(config, name, lambda : int(get(None,name,default)))
|
||||||
|
planet_predefined_options.append(name)
|
||||||
|
|
||||||
# define a list planet-level variable
|
# define a list planet-level variable
|
||||||
def define_planet_list(name, default=''):
|
def define_planet_list(name, default=''):
|
||||||
setattr(config, name, lambda : expand(get(None,name,default)))
|
setattr(config, name, lambda : expand(get(None,name,default)))
|
||||||
@ -91,7 +96,6 @@ def __init__():
|
|||||||
define_planet('cache_directory', "cache")
|
define_planet('cache_directory', "cache")
|
||||||
define_planet('log_level', "WARNING")
|
define_planet('log_level', "WARNING")
|
||||||
define_planet('log_format', "%(levelname)s:%(name)s:%(message)s")
|
define_planet('log_format', "%(levelname)s:%(name)s:%(message)s")
|
||||||
define_planet('feed_timeout', 20)
|
|
||||||
define_planet('date_format', "%B %d, %Y %I:%M %p")
|
define_planet('date_format', "%B %d, %Y %I:%M %p")
|
||||||
define_planet('new_date_format', "%B %d, %Y")
|
define_planet('new_date_format', "%B %d, %Y")
|
||||||
define_planet('generator', 'Venus')
|
define_planet('generator', 'Venus')
|
||||||
@ -102,6 +106,8 @@ def __init__():
|
|||||||
define_planet('output_dir', 'output')
|
define_planet('output_dir', 'output')
|
||||||
define_planet('spider_threads', 0)
|
define_planet('spider_threads', 0)
|
||||||
|
|
||||||
|
define_planet_int('feed_timeout', 20)
|
||||||
|
|
||||||
define_planet_list('template_files')
|
define_planet_list('template_files')
|
||||||
define_planet_list('bill_of_materials')
|
define_planet_list('bill_of_materials')
|
||||||
define_planet_list('template_directories', '.')
|
define_planet_list('template_directories', '.')
|
||||||
|
@ -4,6 +4,7 @@ link = http://example.com/
|
|||||||
template_files = index.html.tmpl atom.xml.tmpl
|
template_files = index.html.tmpl atom.xml.tmpl
|
||||||
items_per_page = 50
|
items_per_page = 50
|
||||||
filters = foo
|
filters = foo
|
||||||
|
feed_timeout=30
|
||||||
|
|
||||||
[index.html.tmpl]
|
[index.html.tmpl]
|
||||||
days_per_page = 7
|
days_per_page = 7
|
||||||
|
@ -58,3 +58,11 @@ class ConfigTest(unittest.TestCase):
|
|||||||
def test_filters(self):
|
def test_filters(self):
|
||||||
self.assertEqual(['foo','bar'], config.filters('feed2'))
|
self.assertEqual(['foo','bar'], config.filters('feed2'))
|
||||||
self.assertEqual(['foo'], config.filters('feed1'))
|
self.assertEqual(['foo'], config.filters('feed1'))
|
||||||
|
|
||||||
|
# ints
|
||||||
|
|
||||||
|
def test_timeout(self):
|
||||||
|
self.assertEqual(30,
|
||||||
|
config.feed_timeout())
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user