# HG changeset patch # User Jeff Hammel # Date 1332795828 25200 # Node ID dbfabe96187e791723248fbb0e3bf556669b8561 # Parent cadc9514f60a698d28456b70ed36bc02c2fdabaf start to add types...still have some things to work out here diff -r cadc9514f60a -r dbfabe96187e configuration/config.py --- a/configuration/config.py Mon Mar 26 13:54:43 2012 -0700 +++ b/configuration/config.py Mon Mar 26 14:03:48 2012 -0700 @@ -75,6 +75,19 @@ ### methods for optparse ### XXX could go in a subclass + @classmethod + def bool_cli(cls, value): + if value.get('default'): + pass + @classmethod + def list_cli(cls, value): + # TODO: could use 'extend' + # - http://hg.mozilla.org/build/mozharness/file/5f44ba08f4be/mozharness/base/config.py#l41 + return dict(action='append') + + types = {bool: bool_cli, + list: list_cli} + def optparse_options(self, parser): """add optparse options to a OptionParser instance""" for key, value in self.items():