From: Neil Date: Wed, 17 Apr 2013 14:06:34 +0000 (+0200) Subject: Disable logging earlier X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=20dd9168a45c3bf566e47604418d7d432854946b;p=erdslangetjie.git Disable logging earlier --- 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()