From: Neil Date: Fri, 19 Apr 2013 15:19:04 +0000 (+0200) Subject: Log some info on level calls X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=ec61c4e13ee1495884112c543eadccae9220e8f5;p=erdslangetjie.git Log some info on level calls --- diff --git a/erdslangetjie/editor/editor.py b/erdslangetjie/editor/editor.py index 3a6b4ec..3cf3d6d 100644 --- a/erdslangetjie/editor/editor.py +++ b/erdslangetjie/editor/editor.py @@ -49,7 +49,7 @@ class EditorWindow(FloatLayout): self.level = level else: self.level = 'levels/' + level - self.level_obj = Level(level_data) + self.level_obj = Level(level_data, self.level) level_data.close() self.level_obj.load_tiles() diff --git a/erdslangetjie/level.py b/erdslangetjie/level.py index 2246b1f..9ebb6f4 100644 --- a/erdslangetjie/level.py +++ b/erdslangetjie/level.py @@ -3,6 +3,9 @@ import os from data import load_image, load, filepath + +from kivy.logger import Logger + WALL = '.' FLOOR = ' ' ENTRY = 'E' @@ -13,7 +16,7 @@ BUTTON = 'B' class Level(object): - def __init__(self, levelfile): + def __init__(self, levelfile, name): self._data = [] self.exit_pos = [] self.enter_pos = None @@ -21,6 +24,7 @@ class Level(object): self._changed = [] self._gates = {} self._buttons = {} + self._name = name # Because of how kivy's coordinate system works, # we reverse the lines so things match up between # the file and the display (top of file == top of display) @@ -29,6 +33,7 @@ class Level(object): def load_tiles(self): """Load the list of tiles for the level""" + Logger.info('%s: load tiles' % self._name) self._tiles = [] self._gates = {} self._buttons = {} @@ -296,7 +301,7 @@ class LevelList(object): line = line.strip() if os.path.exists(filepath(line)): level_file = load(line) - level = Level(level_file) + level = Level(level_file, line) level_file.close() try: level.validate()