Rename to meaningful variable name

This commit is contained in:
Lucas Noki 2020-01-25 01:02:59 +01:00
parent d2c729f0ab
commit 153b8f6d04

View File

@ -96,7 +96,7 @@ class SwapModule(AbstractModule):
subprocess.call(get_swapiness, shell=True) subprocess.call(get_swapiness, shell=True)
def _adjust_swapiness_temp(self): def _adjust_swapiness_temp(self):
actions = { options = {
"Light": 25, "Light": 25,
"Default": 60, "Default": 60,
"Aggressive": 100 "Aggressive": 100
@ -106,14 +106,14 @@ class SwapModule(AbstractModule):
'type': 'list', 'type': 'list',
'message': 'Select action', 'message': 'Select action',
'name': 'action', 'name': 'action',
'choices': list(map(lambda x: {"name": x}, actions.keys())) 'choices': list(map(lambda x: {"name": x}, options.keys()))
} }
] ]
selected_swapiness = prompt(menu)['action'] selected_swapiness = prompt(menu)['action']
adjust = "sudo sysctl vm.swappiness=" + str(actions[selected_swapiness]) adjust = "sudo sysctl vm.swappiness=" + str(options[selected_swapiness])
subprocess.call(adjust, shell=True) subprocess.call(adjust, shell=True)
print("Temporary swapiness is " + str(actions[selected_swapiness])) print("Temporary swapiness is " + str(options[selected_swapiness]))
def _delete_swap(self): def _delete_swap(self):
location = self._swap_location_check() location = self._swap_location_check()