mirror of
https://github.com/akuker/RASCSI.git
synced 2024-05-28 09:41:33 +00:00
52e4a92aec
* Bump black from 22.8.0 to 24.3.0 in /python/web Bumps [black](https://github.com/psf/black) from 22.8.0 to 24.3.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/22.8.0...24.3.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com> * Github CI: Backend web test runner use python 3.9.19 * Reformat python sources with black * Docker: Bump to python 3.9-slim image for pytest * Bump pytest version to 8.1.1 * Bump more library versions, and freeze them --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Markstedt <daniel@mindani.net>
29 lines
877 B
Python
29 lines
877 B
Python
"""Module implementing a blank screensaver"""
|
|
|
|
from menu.screensaver import ScreenSaver
|
|
|
|
|
|
class BlankScreenSaver(ScreenSaver):
|
|
"""Class implementing a blank screen safer that simply blanks the screen after a
|
|
configured activation delay"""
|
|
|
|
def __init__(self, activation_delay, menu_renderer):
|
|
super().__init__(activation_delay, menu_renderer)
|
|
self._initial_draw_call = None
|
|
|
|
def draw_screensaver(self):
|
|
if self._initial_draw_call is True:
|
|
self.menu_renderer.blank_screen()
|
|
else:
|
|
self._initial_draw_call = False
|
|
|
|
def check_timer(self):
|
|
already_enabled = False
|
|
if self.enabled is True:
|
|
already_enabled = True
|
|
|
|
super().check_timer()
|
|
|
|
if self.enabled is True and already_enabled is False: # new switch to screensaver
|
|
self._initial_draw_call = True
|