From: Simon Cross Date: Sat, 5 Mar 2016 19:54:15 +0000 (+0200) Subject: Make new images safe. X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=f3ab2c4223c971a78ac663f26f6ee3352d7d801b;p=koperkapel.git Make new images safe. --- diff --git a/koperkapel/scenes/menu.py b/koperkapel/scenes/menu.py index b5d7815..956a4b1 100644 --- a/koperkapel/scenes/menu.py +++ b/koperkapel/scenes/menu.py @@ -4,6 +4,7 @@ from pgzero.constants import keys from pgzero.loaders import images from ..actors.navigator import ActorNavigator from ..actors.orientatedsurf import OrientatedSurfActor, SelectableSurfActor +from ..util import safepath from .base import Scene, ChangeSceneEvent, WorldEvent, QuitEvent @@ -19,7 +20,7 @@ class MenuScene(Scene): def _init_bg(self): self.actors.default.clear() self.actors.default.add(OrientatedSurfActor( - images.load("splash/background"))) + images.load(safepath("splash/background")))) def _init_buttons(self): self._nav = ActorNavigator() @@ -39,8 +40,8 @@ class MenuScene(Scene): def _build_button(self, name, action): actor = SelectableSurfActor( - images.load("splash/%s" % (name,)), - images.load("splash/%s_selected" % (name,))) + images.load(safepath("splash/%s" % (name,))), + images.load(safepath("splash/%s_selected" % (name,)))) actor.action = action return actor