mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Last fix?
This commit is contained in:
parent
9dcf612f9d
commit
898ac3808f
2 changed files with 10 additions and 5 deletions
|
|
@ -184,10 +184,11 @@ class URLWrapper(object):
|
||||||
def _from_settings(self, key):
|
def _from_settings(self, key):
|
||||||
setting = "%s_%s" % (self.__class__.__name__.upper(), key)
|
setting = "%s_%s" % (self.__class__.__name__.upper(), key)
|
||||||
value = self.settings[setting]
|
value = self.settings[setting]
|
||||||
value = value is not False and value or '' # change to '' only False
|
if not isinstance(value, (str, unicode)):
|
||||||
if value == '':
|
logger.warning(u'%s is set to %s' % (setting, value))
|
||||||
logger.warning(u'%s is disabled' % setting)
|
return value
|
||||||
return unicode(value).format(**self.as_dict())
|
else:
|
||||||
|
return unicode(value).format(**self.as_dict())
|
||||||
|
|
||||||
url = property(functools.partial(_from_settings, key='URL'))
|
url = property(functools.partial(_from_settings, key='URL'))
|
||||||
save_as = property(functools.partial(_from_settings, key='SAVE_AS'))
|
save_as = property(functools.partial(_from_settings, key='SAVE_AS'))
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,11 @@ class Writer(object):
|
||||||
:param **kwargs: additional variables to pass to the templates
|
:param **kwargs: additional variables to pass to the templates
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not name: return
|
if name is False:
|
||||||
|
return
|
||||||
|
elif not name:
|
||||||
|
# other stuff, just return for now
|
||||||
|
return
|
||||||
|
|
||||||
def _write_file(template, localcontext, output_path, name):
|
def _write_file(template, localcontext, output_path, name):
|
||||||
"""Render the template write the file."""
|
"""Render the template write the file."""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue