Example #1
0
 def add_options(self, options, force=False, resolve_conflicts=False):
     """
     Adds `options` from a given mapping.
     """
     for identifier, option in iter_mapping(options):
         self.add_option(
             identifier, option, force=force,
             resolve_conflicts=resolve_conflicts
         )
Example #2
0
 def test_iter_mapping(self):
     self.assert_equal(list(iter_mapping([("foo", 1), ("bar", 2)])), [("foo", 1), ("bar", 2)])
     self.assert_equal(list(iter_mapping({"foo": 1, "bar": 2})), [("foo", 1), ("bar", 2)])
Example #3
0
 def add_commands(self, commands, force=False):
     """
     Adds `commands` from a given mapping.
     """
     for name, command in iter_mapping(commands):
         self.add_command(name, command)