From e7542fec443c64cf182d948a381557cee3cfad43 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 21 Aug 2015 18:23:46 -0400 Subject: [PATCH] move debug setting, remove debug print --- config.py | 12 +++++++----- eos/db/migration.py | 2 -- pyfa.py | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/config.py b/config.py index e9f69fbd2..0f813b58b 100644 --- a/config.py +++ b/config.py @@ -17,11 +17,6 @@ debug = False # Defines if our saveddata will be in pyfa root or not saveInRoot = False -if debug: - logLevel = logging.DEBUG -else: - logLevel = logging.WARN - # Version data version = "1.13.3" tag = "git" @@ -67,12 +62,19 @@ def __createDirs(path): os.makedirs(path) def defPaths(): + global debug global pyfaPath global savePath global staticPath global saveDB global gameDB global saveInRoot + + if debug: + logLevel = logging.DEBUG + else: + logLevel = logging.WARN + # The main pyfa directory which contains run.py # Python 2.X uses ANSI by default, so we need to convert the character encoding pyfaPath = getattr(configforced, "pyfaPath", pyfaPath) diff --git a/eos/db/migration.py b/eos/db/migration.py index 63d3a515a..dcf8636df 100644 --- a/eos/db/migration.py +++ b/eos/db/migration.py @@ -13,8 +13,6 @@ def update(saveddata_engine): dbVersion = getVersion(saveddata_engine) appVersion = migrations.appVersion - print dbVersion, appVersion - if dbVersion == appVersion: return diff --git a/pyfa.py b/pyfa.py index ed327d871..81899183a 100755 --- a/pyfa.py +++ b/pyfa.py @@ -30,6 +30,7 @@ usage = "usage: %prog [--root]" parser = OptionParser(usage=usage) parser.add_option("-r", "--root", action="store_true", dest="rootsavedata", help="if you want pyfa to store its data in root folder, use this option", default=False) parser.add_option("-w", "--wx28", action="store_true", dest="force28", help="Force usage of wxPython 2.8", default=False) +parser.add_option("-d", "--debug", action="store_true", dest="debug", help="Set logger to debug level.", default=False) (options, args) = parser.parse_args() @@ -79,6 +80,8 @@ if __name__ == "__main__": # Configure paths if options.rootsavedata is True: config.saveInRoot = True + + config.debug = options.debug config.defPaths() # Basic logging initialization