From 43a58a7be48208f8d87ee5256c84008a02425ecf Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Fri, 29 Mar 2024 16:46:50 +0200 Subject: docstring etc linting --- src/sliceitoff/display/display.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/sliceitoff/display/display.py') diff --git a/src/sliceitoff/display/display.py b/src/sliceitoff/display/display.py index bdb2514..65b4713 100644 --- a/src/sliceitoff/display/display.py +++ b/src/sliceitoff/display/display.py @@ -1,13 +1,15 @@ +""" display.display - Routines to init and display graphics on screen """ import os import pygame from .scaling import Scaling -from .colors import CGA_COLORS +from .static import CGA_COLORS DEBUG = os.getenv("DEBUG") class Display(): + """display.Display - Handles graphics. Init, clear, draw, borders... """ def __init__(self): pygame.display.init() mode_info = pygame.display.Info() @@ -16,7 +18,6 @@ class Display(): pygame.FULLSCREEN | pygame.SCALED, vsync = 1 ) Scaling.update_scaling(self.screen.get_size()) - #self.screen.fill(0) if DEBUG: print( "DISPLAY: \n" @@ -24,6 +25,9 @@ class Display(): f" {Scaling.borders = }\n" f" {Scaling.factor = }\n") + def __del__(self): + pygame.display.quit() + def update(self, groups = None): """ Updates the screen: clear, blit gropus and flip """ self.screen.fill(CGA_COLORS[4], rect=Scaling.active) @@ -32,6 +36,3 @@ class Display(): self.screen.fill(0, rect=Scaling.borders[0]) self.screen.fill(0, rect=Scaling.borders[1]) pygame.display.flip() - - def __del__(self): - pygame.display.quit() -- cgit v1.2.3