From f9e78f3d80153cd6b937fef8d0000a8bbe903564 Mon Sep 17 00:00:00 2001 From: Chris Dolan Date: Wed, 18 Oct 2006 15:32:56 -0500 Subject: [PATCH] - Auto-create the cache dir if it doesn't exist - template_directories defaults to '.' - Bugfix in xsltproc shell argument order - Add cache dir to .bzrignore, plus Mac .DS_Store file --- .bzrignore | 2 ++ planet/config.py | 6 +++--- planet/shell/xslt.py | 2 +- planet/spider.py | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.bzrignore b/.bzrignore index f8b5310..1d1886c 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1 +1,3 @@ *.tmplc +.DS_Store +cache diff --git a/planet/config.py b/planet/config.py index 99d3cda..e81bf33 100644 --- a/planet/config.py +++ b/planet/config.py @@ -69,8 +69,8 @@ def __init__(): planet_predefined_options.append(name) # define a list planet-level variable - def define_planet_list(name): - setattr(config, name, lambda : expand(get(None,name,''))) + def define_planet_list(name, default=''): + setattr(config, name, lambda : expand(get(None,name,default))) planet_predefined_options.append(name) # define a string template-level variable @@ -100,7 +100,7 @@ def __init__(): define_planet_list('template_files') define_planet_list('bill_of_materials') - define_planet_list('template_directories') + define_planet_list('template_directories', '.') define_planet_list('filter_directories') # template options diff --git a/planet/shell/xslt.py b/planet/shell/xslt.py index ecdd673..d667598 100644 --- a/planet/shell/xslt.py +++ b/planet/shell/xslt.py @@ -55,7 +55,7 @@ def run(script, doc, output_file=None, options={}): cmdopts += ['--stringparam', key, quote(value, apos=r"\'")] os.system('xsltproc %s %s %s > %s' % - (script, ' '.join(cmdopts), docfile, output_file)) + (' '.join(cmdopts), script, docfile, output_file)) os.unlink(docfile) else: import sys diff --git a/planet/spider.py b/planet/spider.py index da8253b..974b82d 100644 --- a/planet/spider.py +++ b/planet/spider.py @@ -115,6 +115,8 @@ def spiderFeed(feed): # read cached feed info sources = config.cache_sources_directory() + if not os.path.exists(sources): + os.makedirs(sources, 0700) feed_source = filename(sources, feed) feed_info = feedparser.parse(feed_source) if feed_info.feed.get('planet_http_status',None) == '410': return