comparison sat/core/constants.py @ 2955:bb36cf6289c6

core (constants): "on" can now be used as True value in bool method.
author Goffi <goffi@goffi.org>
date Sun, 26 May 2019 22:22:00 +0200
parents 9241f9d1f9e5
children 767e1ef6e1bd
comparison
equal deleted inserted replaced
2954:5e72efd2f95d 2955:bb36cf6289c6
436 436
437 @classmethod 437 @classmethod
438 def bool(cls, value): 438 def bool(cls, value):
439 """@return (bool): bool value for associated constant""" 439 """@return (bool): bool value for associated constant"""
440 assert isinstance(value, basestring) 440 assert isinstance(value, basestring)
441 return value.lower() in (cls.BOOL_TRUE, "1", "yes") 441 return value.lower() in (cls.BOOL_TRUE, "1", "yes", "on")
442 442
443 @classmethod 443 @classmethod
444 def boolConst(cls, value): 444 def boolConst(cls, value):
445 """@return (str): constant associated to bool value""" 445 """@return (str): constant associated to bool value"""
446 assert isinstance(value, bool) 446 assert isinstance(value, bool)