mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-03-26 14:44:40 +01:00
edit config bool getter
This commit is contained in:
parent
4cd7dd183a
commit
2e515ff15d
|
|
@ -65,10 +65,10 @@ class Config:
|
||||||
@param section: Section to read from
|
@param section: Section to read from
|
||||||
@param key: Value to read
|
@param key: Value to read
|
||||||
@param sharePoint: Name of the global config share (empty is only local)
|
@param sharePoint: Name of the global config share (empty is only local)
|
||||||
@return The value or None"""
|
@return An Integer or 0"""
|
||||||
value = self._get(section, key, sharePoint)
|
value = self._get(section, key, sharePoint)
|
||||||
if value is None:
|
if value is None:
|
||||||
return int(0)
|
return 0
|
||||||
return int(value)
|
return int(value)
|
||||||
|
|
||||||
def getBool(self, section, key, sharePoint=""):
|
def getBool(self, section, key, sharePoint=""):
|
||||||
|
|
@ -77,8 +77,10 @@ class Config:
|
||||||
@param section: Section to read from
|
@param section: Section to read from
|
||||||
@param key: Value to read
|
@param key: Value to read
|
||||||
@param sharePoint: Name of the global config share (empty is only local)
|
@param sharePoint: Name of the global config share (empty is only local)
|
||||||
@return The value or None"""
|
@return True or False"""
|
||||||
return bool(self._get(section, key, sharePoint))
|
if self._get(section, key, sharePoint).lower() in ["1", "true", "yes"]:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def getStr(self, section, key, sharePoint=""):
|
def getStr(self, section, key, sharePoint=""):
|
||||||
"""!Method to read a single config entry as string
|
"""!Method to read a single config entry as string
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue