diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-03-13 17:52:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 17:52:58 -0400 |
commit | 40d3e5bfeb286eaa507363b78637d6198372737b (patch) | |
tree | 9d78a9b4ae804e38c2cdf05269996cda54310f66 /cmd2.py | |
parent | 082154fd0aa9c4d931da303c6ef57a98790b10fe (diff) | |
parent | fe15d07eaaf6501a1acf9e53a1b41dff3810caf8 (diff) | |
download | cmd2-git-40d3e5bfeb286eaa507363b78637d6198372737b.tar.gz |
Merge pull request #305 from albertored/fix/submenu-require-shares
AddSubMenu should work with default kwargs
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -867,14 +867,14 @@ class AddSubmenu(object): raise ValueError("reformat_prompt should be either a format string or None") self.reformat_prompt = reformat_prompt + self.shared_attributes = {} if shared_attributes is None else shared_attributes if require_predefined_shares: - for attr in shared_attributes.keys(): + for attr in self.shared_attributes.keys(): if not hasattr(submenu, attr): raise AttributeError("The shared attribute '{attr}' is not defined in {cmd}. Either define {attr} " "in {cmd} or set require_predefined_shares=False." .format(cmd=submenu.__class__.__name__, attr=attr)) - self.shared_attributes = {} if shared_attributes is None else shared_attributes self.create_subclass = create_subclass def __call__(self, cmd_obj): |