diff --git a/.bin/Scripts/system_setup.py b/.bin/Scripts/system_setup.py index b840c64b..6886e23f 100644 --- a/.bin/Scripts/system_setup.py +++ b/.bin/Scripts/system_setup.py @@ -124,12 +124,10 @@ SETUP_ACTIONS = OrderedDict({ }) SETUP_ACTION_KEYS = ( 'Function', - 'If answer', 'If not activated', 'Just run', 'KWArgs', 'Pause', - 'Win10 only', ) SETUP_QUESTIONS = { # AV @@ -149,11 +147,22 @@ SETUP_QUESTIONS = { # Functions -def get_actions(setup_mode): +def get_actions(setup_mode, answers): """Get actions to perform based on setup_mode, returns OrderedDict.""" actions = OrderedDict({}) for _key, _val in SETUP_ACTIONS.items(): - _action = {'Enabled': _val.get(setup_mode, False)} + _action = {} + _if_answer = _val.get('If answer', False) + _win10_only = _val.get('Win10 only', False) + + # Set enabled status + _action['Enabled'] = _val.get(setup_mode, False) + if _if_answer: + _action['Enabled'] &= answers[_if_answer] + if _win10_only: + _action['Enabled'] &= global_vars['OS']['Version'] == '10' + + # Set other keys for _sub_key in SETUP_ACTION_KEYS: _action[_sub_key] = _val.get(_sub_key, None) actions[_key] = _action @@ -258,12 +267,12 @@ def main(): # Get setup mode setup_mode = get_mode() - # Get actions to perform - actions = get_actions(setup_mode) - # Get answers to setup questions answers = get_answers(setup_mode) + # Get actions to perform + actions = get_actions(setup_mode, answers) + # Perform actions # TODO