mirror of
https://git.zavage.net/Zavage-Software/app_skellington.git
synced 2024-12-21 14:19:21 -07:00
repeated fix for python version
This commit is contained in:
parent
ffc39641be
commit
157a9e501c
@ -83,6 +83,7 @@ class CommandTree:
|
||||
# NOTE(MG) Fix below strategizes whether to pass in 'required'
|
||||
# paremter to ArgumentParser.add_subparsers()
|
||||
# which was added in in Python3.7.
|
||||
# Must also be written into SubMenu.create_submenu.
|
||||
func_args = {
|
||||
'dest': param_name,
|
||||
'metavar': param_name,
|
||||
@ -469,12 +470,27 @@ class SubMenu:
|
||||
help='sub-submenu help',
|
||||
description='sub-sub description')
|
||||
|
||||
# NOTE(MG) Fix below strategizes whether to pass in 'required'
|
||||
# paremter to ArgumentParser.add_subparsers()
|
||||
# which was added in in Python3.7.
|
||||
# Must also be written into SubMenu.create_submenu.
|
||||
func_args = {
|
||||
'dest': var_name,
|
||||
'metavar': var_name,
|
||||
'required': is_required
|
||||
}
|
||||
if (
|
||||
sys.version_info.major == 3
|
||||
and sys.version_info.minor <= 6
|
||||
):
|
||||
if is_required:
|
||||
_bootstrap_logger.warn('Unable to enforce required submenu: Requires >= Python 3.7')
|
||||
del func_args['required']
|
||||
# Turn entry into a submenu of it's own:
|
||||
# type = _SubParsersAction
|
||||
subp_node = entry_node.add_subparsers(
|
||||
dest = var_name,
|
||||
metavar = var_name,
|
||||
required = is_required)
|
||||
**func_args
|
||||
)
|
||||
|
||||
submenu = SubMenu(
|
||||
self.parent,
|
||||
|
Loading…
Reference in New Issue
Block a user