From 32aa61533ca15cfbd15bf5897ef64f30f14e505b Mon Sep 17 00:00:00 2001 From: Brosef Date: Tue, 24 Jun 2025 08:01:53 +0100 Subject: [PATCH] Linted code --- __main__.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/__main__.py b/__main__.py index ed990cd..6d00a4d 100644 --- a/__main__.py +++ b/__main__.py @@ -76,14 +76,14 @@ class Launcher: os.chdir(game.path) # Load the games game.py file. spec = importlib.util.spec_from_file_location(game.id, os.path.join(game.path, 'game.py')) - foo = importlib.util.module_from_spec(spec) - spec.loader.exec_module(foo) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) # Initialise the games Game class, then set the # current game to that. - self.currentGame = foo.Game(self.gameSurface) + self.currentGame = module.Game(self.gameSurface) # Set the window title to the games name pygame.display.set_caption(game.name) - + def update(self): for event in pygame.event.get(): if self.gameRunning: @@ -98,7 +98,7 @@ class Launcher: os.chdir(originalCWD) pygame.display.set_caption('Pain Jam Launcher') # If we launched directly into a game - if args.gameID != None: + if args.gameID is not None: # Exit the launcher when we exit the game self.running = False else: @@ -108,7 +108,7 @@ class Launcher: elif event.type == pygame.KEYDOWN: if event.key == pygame.K_1: self.loadGame(games['russianRoulette']) - + if self.gameRunning: self.currentGame._update() self.screen.blit(self.currentGame.surf, (0, 0)) @@ -118,13 +118,13 @@ class Launcher: pygame.display.update() self.clock.tick(args.fpsCap) - + @property def gameRunning(self): - return self.currentGame != None + return self.currentGame is not None launcher = Launcher() -if args.gameID != None: +if args.gameID is not None: launcher.loadGame(games[args.gameID]) while launcher.running: launcher.update()