aboutsummaryrefslogtreecommitdiff
path: root/pyfingerd/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyfingerd/utils.py')
-rw-r--r--pyfingerd/utils.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/pyfingerd/utils.py b/pyfingerd/utils.py
index 99d8546..c8f364a 100644
--- a/pyfingerd/utils.py
+++ b/pyfingerd/utils.py
@@ -3,11 +3,10 @@
# Copyright (C) 2021-2022 Thomas Touhey <thomas@touhey.fr>
# This file is part of the pyfingerd Python 3.x module, which is MIT-licensed.
# *****************************************************************************
-""" Utilities for the pyfingerd module. """
+"""Utilities for the pyfingerd module."""
import logging as _logging
import re as _re
-
from datetime import timedelta as _td
from typing import Optional as _Optional, Union as _Union
@@ -24,8 +23,7 @@ error_logger = _logging.getLogger('pyfingerd.error')
def parse_delta(raw: str) -> _td:
- """ Parse a delta string as found in the configuration files. """
-
+ """Parse a delta string as found in the configuration files."""
try:
delta = _td()
@@ -54,8 +52,7 @@ def parse_delta(raw: str) -> _td:
def format_delta(td: _td) -> str:
- """ Create a delta string. """
-
+ """Create a delta string."""
sls = zip(
(_td(days=7), _td(days=1), _td(seconds=3600), _td(seconds=60)),
'wdhm',
@@ -93,8 +90,7 @@ def make_delta(
value: _Optional[_Union[str, int, float, _td]],
allow_none: bool = False,
) -> _td:
- """ Make a delta from a raw value. """
-
+ """Make a delta from a raw value."""
if value is None:
if not allow_none:
raise ValueError('must not be None')