| Conditions | 3 |
| Total Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 1 |
| CRAP Score | 8.2077 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | # coding: utf-8 |
||
| 25 | 1 | def field_from_ini(field, ini, section, option, default=_NO_VALUE): |
|
| 26 | getter = _get_getter(field.typeclass, ini) |
||
| 27 | try: |
||
| 28 | return getter(section, option) |
||
| 29 | except (configparser.NoSectionError, configparser.NoOptionError): |
||
| 30 | return ( |
||
| 31 | default |
||
| 32 | if default is not _NO_VALUE else |
||
| 33 | field.default |
||
| 34 | ) |
||
| 35 |