From: W. Trevor King Date: Thu, 8 Sep 2011 14:34:28 +0000 (-0400) Subject: Fix dumping for ConfigListSetting (a subclass of ConfigSetting). X-Git-Tag: v0.2~29 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=93bc639f9e61ffe57fdfc4ae6a77ca8d0c61c6ac;p=h5config.git Fix dumping for ConfigListSetting (a subclass of ConfigSetting). --- diff --git a/h5config/config.py b/h5config/config.py index 66ba8ee..ce195e6 100644 --- a/h5config/config.py +++ b/h5config/config.py @@ -300,16 +300,16 @@ class Config (dict): name = setting.name value = self[name] try: - if isinstance(setting, ConfigSetting): - if value is not None: - lines.append(value.dump(help=help, prefix=prefix+' ')) - continue - elif isinstance(setting, ConfigListSetting): + if isinstance(setting, ConfigListSetting): if value: for config in value: lines.append( config.dump(help=help, prefix=prefix+' ')) continue + elif isinstance(setting, ConfigSetting): + if value is not None: + lines.append(value.dump(help=help, prefix=prefix+' ')) + continue value_string = setting.convert_to_text(self[name]) if help: help_string = '\t({})'.format(setting.help())