Permalink
Browse files

- 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
  • Loading branch information...
1 parent ce86fb1 commit f9e78f3d80153cd6b937fef8d0000a8bbe903564 Chris Dolan committed Oct 18, 2006
Showing with 8 additions and 4 deletions.
  1. +2 −0 .bzrignore
  2. +3 −3 planet/config.py
  3. +1 −1 planet/shell/xslt.py
  4. +2 −0 planet/spider.py
View
@@ -1 +1,3 @@
*.tmplc
+.DS_Store
+cache
View
@@ -69,8 +69,8 @@ def define_planet(name, default):
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 define_tmpl_int(name, default):
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
View
@@ -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
View
@@ -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

0 comments on commit f9e78f3

Please sign in to comment.