1234567891011121314151617181920 |
- import yaml
- from django.conf import settings
- def yaml_coerce(value):
- """
- Pass in a string dictionary and convert it into proper python dictionary
- """
- if isinstance(value, str):
-
-
-
- return yaml.load(f'dummy: {value}', Loader=yaml.SafeLoader)['dummy']
- return value
- def print_(*args, **kwargs):
- if settings.ENABLE_PRINT_STATEMENTS:
- print(*args, **kwargs)
|