little improvement in config

This commit is contained in:
Bastian Schroll 2018-01-17 21:54:58 +01:00
parent 56b97e471f
commit 3e05638c62

View file

@ -50,11 +50,10 @@ class Config:
Shares the local _config to the class wide global _sharedConfig
@param sharePoint: Name of the global share point
@return True or False"""
try:
bool(self._sharePoints[sharePoint]) # todo not a nice method to check
if sharePoint in self._sharePoints:
logging.error("cannot share config - name is always in use: %s", sharePoint)
return False
except:
else:
self._sharePoints[sharePoint] = self._config
logging.debug("add config sharePoint: %s", sharePoint)
return True