items.append(item)
return items
-def setting_to_argument(self, setting):
- """Convert a :class:`~hooke.conf.Setting` to an
- :class:`~hooke.command.Argument`.
+def argument_to_setting(self, section_name, argument):
+ """Convert an :class:`~hooke.command.Argument` to a
+ `~hooke.conf.Setting`.
+
+ This is a lossy transition, because
+ :class:`~hooke.command.Argument`\s store more information than
+ `~hooke.conf.Setting`\s.
"""
- TODO
+ return Setting(section_name, option=argument.name, value=argument.default,
+ help=argument._help)