mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 21:24:28 +00:00
12 lines
271 B
Python
12 lines
271 B
Python
import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def strtobool(s: str) -> bool:
|
|
if s in ['y', 'yes', 'true', 'on', '1']:
|
|
return True
|
|
if s in ['n', 'no', 'false', 'off', '0']:
|
|
return False
|
|
|
|
raise ValueError(f'cannot convert {s} to bool')
|