From 20dd9168a45c3bf566e47604418d7d432854946b Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 17 Apr 2013 16:06:34 +0200 Subject: [PATCH] Disable logging earlier --- erdslangetjie/__main__.py | 9 +-------- erdslangetjie/constants.py | 15 +++++++++++++-- erdslangetjie/editor/editor.py | 9 +-------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/erdslangetjie/__main__.py b/erdslangetjie/__main__.py index e6bc2ce..ce2864b 100644 --- a/erdslangetjie/__main__.py +++ b/erdslangetjie/__main__.py @@ -1,11 +1,9 @@ -import kivy import pygame -kivy.require('1.6.0') +from erdslangetjie.constants import TILE_SIZE from kivy.app import App from kivy.uix.widget import Widget -from kivy.logger import Logger, LoggerHistory from kivy.uix.relativelayout import RelativeLayout from kivy.uix.scrollview import ScrollView from kivy.uix.label import Label @@ -15,7 +13,6 @@ from kivy.utils import platform from erdslangetjie.level import LevelList from erdslangetjie.data import load_image from erdslangetjie.player import ThePlayer, Nemesis -from erdslangetjie.constants import TILE_SIZE, QUIET class GameWindow(RelativeLayout): @@ -339,8 +336,4 @@ class GameApp(App): def main(): """ Erdslangetjie, a maze game of eluding nemesis """ - if QUIET: - for hdlr in Logger.handlers[:]: - if not isinstance(hdlr, LoggerHistory): - Logger.removeHandler(hdlr) GameApp().run() diff --git a/erdslangetjie/constants.py b/erdslangetjie/constants.py index f178afc..85041cf 100644 --- a/erdslangetjie/constants.py +++ b/erdslangetjie/constants.py @@ -1,8 +1,19 @@ -from kivy.utils import platform -from kivy.config import Config +import kivy + +kivy.require('1.6.0') + +from kivy.logger import Logger, LoggerHistory QUIET = False # kivy logging - change for release +if QUIET: + for hdlr in Logger.handlers[:]: + if not isinstance(hdlr, LoggerHistory): + Logger.removeHandler(hdlr) + +from kivy.utils import platform +from kivy.config import Config + if platform() != 'android': TILE_SIZE = 38 Config.set('graphics', 'width', '1026') diff --git a/erdslangetjie/editor/editor.py b/erdslangetjie/editor/editor.py index 04c95d9..4cfe183 100644 --- a/erdslangetjie/editor/editor.py +++ b/erdslangetjie/editor/editor.py @@ -1,18 +1,15 @@ import sys import os -import kivy -kivy.require('1.6.0') +from erdslangetjie.constants import TILE_SIZE from kivy.app import App -from kivy.logger import Logger, LoggerHistory from kivy.uix.widget import Widget from kivy.uix.floatlayout import FloatLayout from kivy.graphics import Color, Rectangle from erdslangetjie.data import filepath, load from erdslangetjie.level import Level -from erdslangetjie.constants import TILE_SIZE, QUIET class EditorWindow(FloatLayout): @@ -70,10 +67,6 @@ def main(): level = sys.argv[1] else: level = 'level1.txt' - if QUIET: - for hdlr in Logger.handlers[:]: - if not isinstance(hdlr, LoggerHistory): - Logger.removeHandler(hdlr) EditorApp(level).run() -- 2.34.1