Fix dumping for ConfigListSetting (a subclass of ConfigSetting).
authorW. Trevor King <wking@drexel.edu>
Thu, 8 Sep 2011 14:34:28 +0000 (10:34 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 8 Sep 2011 14:34:28 +0000 (10:34 -0400)
h5config/config.py

index 66ba8ee238742401886d957ba4ebbd7904729370..ce195e60f8a9887cc2612c907fb71c16f1e5e086 100644 (file)
@@ -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())