blob: 1a7bf5f5ded96eaff8a86ed24876a93e1a20c00f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
"""Contain logic for checking average files"""
import re
from .errors import InvalidValue
def valid_value(val):
if re.search("^[0-9]+\.[0-9]{3}$", val):
return float(val)
raise InvalidValue(
f"Invalid value '{val}'.\n"
"Expected string representing a number with exactly three decimal "
"places.")
|