Skip to content

Commit

Permalink
Config: remove log_ini_reads
Browse files Browse the repository at this point in the history
  • Loading branch information
stump committed Jan 6, 2013
1 parent dad61a0 commit 4230a21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
24 changes: 5 additions & 19 deletions src/Config.py
Expand Up @@ -32,7 +32,6 @@
config = None
prototype = {}

logIniReads = 0 #MFH - INI reads disabled by default during the startup period
logUndefinedGets = 0

class MyConfigParser(RawConfigParser):
Expand Down Expand Up @@ -99,11 +98,10 @@ def define(section, option, type, default = None, text = None, options = None, p

def load(fileName = None, setAsDefault = False, type = 0):
"""Load a configuration with the default prototype"""
global config, logIniReads, logUndefinedGets
global config, logUndefinedGets
c = Config(prototype, fileName, type)
if setAsDefault and not config:
config = c
logIniReads = c.get("game", "log_ini_reads")
logUndefinedGets = c.get("game", "log_undefined_gets")
return c

Expand Down Expand Up @@ -170,7 +168,7 @@ def get(self, section, option):
@return: Key value
"""

global logIniReads, logUndefinedGets
global logUndefinedGets

try:
type = self.prototype[section][option].type
Expand All @@ -182,9 +180,6 @@ def get(self, section, option):

value = _convertValue(self.config.get(section, option) if self.config.has_option(section, option) else default, type, default)

#myfingershurt: verbose log output
if logIniReads == 1:
Log.debug("Config.get: %s.%s = %s" % (section, option, value))
return value

def getOptions(self, section, option):
Expand All @@ -195,7 +190,7 @@ def getOptions(self, section, option):
@param option: Option name
@return: Tuple of Key list and Values list
"""
global logIniReads, logUndefinedGets
global logUndefinedGets


try:
Expand All @@ -214,9 +209,6 @@ def getOptions(self, section, option):
value = _convertValue(keys[i], type)
optionList.append(value)

#myfingershurt: verbose log output
if logIniReads == 1:
Log.debug("Config.getOptions: %s.%s = %s" % (section, option, str(optionList)))
return optionList, options

def getTipText(self, section, option):
Expand All @@ -228,7 +220,7 @@ def getTipText(self, section, option):
@return: Tip Text String
"""

global logIniReads, logUndefinedGets
global logUndefinedGets

try:
text = self.prototype[section][option].tipText
Expand All @@ -237,9 +229,6 @@ def getTipText(self, section, option):
Log.warn("Config key %s.%s not defined while reading %s." % (section, option, self.fileName))
text = None

#myfingershurt: verbose log output
if logIniReads == 1:
Log.debug("Config.getTipText: %s.%s = %s" % (section, option, text))
return text

def getDefault(self, section, option):
Expand All @@ -250,7 +239,7 @@ def getDefault(self, section, option):
@param option: Option name
@return: Key value
"""
global logIniReads, logUndefinedGets
global logUndefinedGets


try:
Expand All @@ -263,9 +252,6 @@ def getDefault(self, section, option):

value = _convertValue(default, type)

#myfingershurt: verbose log output
if logIniReads == 1:
Log.debug("Config.getDefault: %s.%s = %s" % (section, option, value))
return value

def set(self, section, option, value):
Expand Down
1 change: 0 additions & 1 deletion src/ConfigDefs.py
Expand Up @@ -210,7 +210,6 @@ def sortOptionsByKey(dict):


#MFH - log settings
Config.define("game", "log_ini_reads", int, 0, text = _("Log INI Reads"), options = {0: _("No"), 1: _("Yes")}, tipText = _("Logs any read to an INI file. This is unnecessary information in bug reports; please leave it disabled unless you are certain it is relevant."))
Config.define("game", "log_class_inits", int, 0, text = _("Log Class Inits"), options = {0: _("No"), 1: _("Yes")}, tipText = _("Logs most class initializations in '__init__'. This is unnecessary information in bug reports; please leave it disabled unless you are certain it is relevant."))
Config.define("game", "log_loadings", int, 0, text = _("Log Loadings"), options = {0: _("No"), 1: _("Yes")}, tipText = _("Logs resource loads. This is unnecessary information in bug reports; please leave it disabled unless you are certain it is relevant."))
Config.define("game", "log_sections", int, 0, text = _("Log MIDI Sections"), options = {0: _("No"), 1: _("Yes")}, tipText = _("Logs MIDI sections. This is unnecessary information in bug reports; please leave it disabled unless you are certain it is relevant."))
Expand Down
1 change: 0 additions & 1 deletion src/Settings.py
Expand Up @@ -900,7 +900,6 @@ def __init__(self, engine):

#MFH - new menu
self.logfileSettings = [
ConfigChoice(engine, engine.config, "game", "log_ini_reads", autoApply = True),#myfingershurt
ConfigChoice(engine, engine.config, "game", "log_class_inits", autoApply = True),#myfingershurt
ConfigChoice(engine, engine.config, "game", "log_loadings", autoApply = True),#myfingershurt
ConfigChoice(engine, engine.config, "game", "log_sections", autoApply = True),#myfingershurt
Expand Down

0 comments on commit 4230a21

Please sign in to comment.