150: NameSpace.__iter__() now iterates through the names, not the members; added NameSpace.__call__() method which iterates through the members; NameSpace no longer requires members to be Proxy instances; updated unit tests and affected code; cleaned up NameSpace docstrings and switch to epydoc param docstrings

This commit is contained in:
Jason Gerard DeRose
2008-08-14 05:46:20 +00:00
parent d95133b66f
commit ba8d32a110
5 changed files with 122 additions and 54 deletions

View File

@@ -187,7 +187,7 @@ class cmd(plugable.Plugin):
return dict(self.normalize_iter(kw))
def default_iter(self, kw):
for option in self.options:
for option in self.options():
if option.name not in kw:
value = option.default(**kw)
if value is not None:
@@ -199,7 +199,7 @@ class cmd(plugable.Plugin):
def validate(self, **kw):
self.print_call('validate', kw, 1)
for opt in self.options:
for opt in self.options():
value = kw.get(opt.name, None)
if value is None:
if opt.required: