From ec61c4e13ee1495884112c543eadccae9220e8f5 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 19 Apr 2013 17:19:04 +0200 Subject: [PATCH] Log some info on level calls --- erdslangetjie/editor/editor.py | 2 +- erdslangetjie/level.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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() -- 2.34.1