mirror of
https://github.com/akuker/RASCSI.git
synced 2024-05-28 09:41:33 +00:00
315ef9f248
* Update config for black and flake8 * Auto-format Python sources with black * Fix issues reported by flake8 * Exclude protobuf files from black * Address formatting feedback
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
"""Module providing the shutdown cycler for the RaSCSI Control Board UI """
|
|
from menu.cycler import Cycler
|
|
|
|
|
|
class RascsiShutdownCycler(Cycler):
|
|
"""Class implementing the shutdown cycler for the RaSCSI Control Board UI"""
|
|
|
|
def __init__(self, menu_controller, sock_cmd, ractl_cmd):
|
|
super().__init__(
|
|
menu_controller,
|
|
sock_cmd,
|
|
ractl_cmd,
|
|
return_entry=True,
|
|
empty_messages=False,
|
|
)
|
|
self.executed_once = False
|
|
|
|
def populate_cycle_entries(self):
|
|
cycle_entries = ["Shutdown"]
|
|
|
|
return cycle_entries
|
|
|
|
def perform_selected_entry_action(self, selected_entry):
|
|
if self.executed_once is False:
|
|
self.executed_once = True
|
|
self._menu_controller.show_timed_message("Shutting down...")
|
|
self.ractl_cmd.shutdown("system")
|
|
return "shutdown"
|
|
|
|
return None
|
|
|
|
def perform_return_action(self):
|
|
self._menu_controller.show_timed_mini_message("")
|
|
self._menu_controller.show_timed_message("")
|
|
|
|
return "return"
|