Linted code
This commit is contained in:
12
__main__.py
12
__main__.py
@ -76,11 +76,11 @@ class Launcher:
|
|||||||
os.chdir(game.path)
|
os.chdir(game.path)
|
||||||
# Load the games game.py file.
|
# Load the games game.py file.
|
||||||
spec = importlib.util.spec_from_file_location(game.id, os.path.join(game.path, 'game.py'))
|
spec = importlib.util.spec_from_file_location(game.id, os.path.join(game.path, 'game.py'))
|
||||||
foo = importlib.util.module_from_spec(spec)
|
module = importlib.util.module_from_spec(spec)
|
||||||
spec.loader.exec_module(foo)
|
spec.loader.exec_module(module)
|
||||||
# Initialise the games Game class, then set the
|
# Initialise the games Game class, then set the
|
||||||
# current game to that.
|
# current game to that.
|
||||||
self.currentGame = foo.Game(self.gameSurface)
|
self.currentGame = module.Game(self.gameSurface)
|
||||||
# Set the window title to the games name
|
# Set the window title to the games name
|
||||||
pygame.display.set_caption(game.name)
|
pygame.display.set_caption(game.name)
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ class Launcher:
|
|||||||
os.chdir(originalCWD)
|
os.chdir(originalCWD)
|
||||||
pygame.display.set_caption('Pain Jam Launcher')
|
pygame.display.set_caption('Pain Jam Launcher')
|
||||||
# If we launched directly into a game
|
# 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
|
# Exit the launcher when we exit the game
|
||||||
self.running = False
|
self.running = False
|
||||||
else:
|
else:
|
||||||
@ -121,10 +121,10 @@ class Launcher:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def gameRunning(self):
|
def gameRunning(self):
|
||||||
return self.currentGame != None
|
return self.currentGame is not None
|
||||||
|
|
||||||
launcher = Launcher()
|
launcher = Launcher()
|
||||||
if args.gameID != None:
|
if args.gameID is not None:
|
||||||
launcher.loadGame(games[args.gameID])
|
launcher.loadGame(games[args.gameID])
|
||||||
while launcher.running:
|
while launcher.running:
|
||||||
launcher.update()
|
launcher.update()
|
||||||
|
|||||||
Reference in New Issue
Block a user