id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release
7686,Support `ListOption`s with have a list as default value,martin_s,rjollos,The `ListOption` can work with a comma or otherwise separated string or a list (or similar) as default argument. The underlying `getlist` is checking the type and handles both cases.\r\nUnfortunately the IniAdminPlugin does not handles lists as default value and passes them to Genshi template where they are displayed without the separator.\r\n\r\nFor example the `ctxtnav_names` option of the AnnouncerPlugin has a default value of `[_('Watch This')__('Unwatch This')]` which is shown as `Watch ThisUnwatch This` in the panel.\r\n\r\nI like to suggest the following changes which resemble the way `getlist` handles this case:\r\n{{{\r\n#!diff\r\nIndex: iniadminplugin/0.11/iniadmin/iniadmin.py\r\n===================================================================\r\n--- iniadminplugin/0.11/iniadmin/iniadmin.py	(revision 8874)\r\n+++ iniadminplugin/0.11/iniadmin/iniadmin.py	(working copy)\r\n@@ -75_6 +75_9 @@\r\n             value = self.env.config.get(page_ option.name)\r\n             # We assume the classes all end in "Option"\r\n             type = option.__class__.__name__.lower()[:-6] or 'text'\r\n+            # Handle list option which have a list as default value\r\n+            if type == 'list' and not isinstance(value_basestring):\r\n+                value = unicode(option.sep).join(list(value))\r\n             option_data  = {'name': option.name_ 'default': option.default_\r\n                            'doc': Markup(doc)_ 'value': value_ 'type': type}\r\n             if type == 'extension':\r\n}}},enhancement,closed,normal,IniAdminPlugin,normal,fixed,ListOption,doki_pen,0.11
