Added run actions section
This commit is contained in:
parent
e8457756fb
commit
aa4356c08c
1 changed files with 36 additions and 1 deletions
|
|
@ -285,7 +285,42 @@ def main():
|
||||||
actions = get_actions(setup_mode, answers)
|
actions = get_actions(setup_mode, answers)
|
||||||
|
|
||||||
# Perform actions
|
# Perform actions
|
||||||
# TODO
|
for action, values in actions.items():
|
||||||
|
kwargs = values.get('KWArgs', {})
|
||||||
|
|
||||||
|
# Print info lines
|
||||||
|
if values.get('Info', False):
|
||||||
|
print_info(values['Info'])
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Print skipped actions
|
||||||
|
if not values.get('Enabled', False):
|
||||||
|
show_data(
|
||||||
|
message='{}...'.format(action),
|
||||||
|
data='Skipped',
|
||||||
|
warning=True,
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Check Windows activation if requested
|
||||||
|
if values.get('If not activated', False) and windows_is_activated():
|
||||||
|
# Skip
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Run function
|
||||||
|
if values.get('Just run', False):
|
||||||
|
values['Function'](**kwargs)
|
||||||
|
else:
|
||||||
|
result = try_and_print(
|
||||||
|
message='{}...'.format(action),
|
||||||
|
function=values['Function'],
|
||||||
|
other_results=OTHER_RESULTS,
|
||||||
|
**kwargs)
|
||||||
|
|
||||||
|
# Pause
|
||||||
|
if values.get('Pause', False):
|
||||||
|
print_standard(values['Pause'])
|
||||||
|
pause()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue