Last fix?

This commit is contained in:
Pavel Puchkin 2012-04-20 11:28:00 +11:00
commit 898ac3808f
2 changed files with 10 additions and 5 deletions

View file

@ -184,10 +184,11 @@ class URLWrapper(object):
def _from_settings(self, key):
setting = "%s_%s" % (self.__class__.__name__.upper(), key)
value = self.settings[setting]
value = value is not False and value or '' # change to '' only False
if value == '':
logger.warning(u'%s is disabled' % setting)
return unicode(value).format(**self.as_dict())
if not isinstance(value, (str, unicode)):
logger.warning(u'%s is set to %s' % (setting, value))
return value
else:
return unicode(value).format(**self.as_dict())
url = property(functools.partial(_from_settings, key='URL'))
save_as = property(functools.partial(_from_settings, key='SAVE_AS'))

View file

@ -99,7 +99,11 @@ class Writer(object):
: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):
"""Render the template write the file."""