Remove dt_humanize

This commit is contained in:
Matthias 2024-04-21 15:50:29 +02:00
parent d48cff3b9a
commit 54c2febe1c
2 changed files with 3 additions and 15 deletions

View File

@ -1,7 +1,6 @@
from freqtrade.util.datetime_helpers import (dt_floor_day, dt_from_ts, dt_humanize, from freqtrade.util.datetime_helpers import (dt_floor_day, dt_from_ts, dt_humanize_delta, dt_now,
dt_humanize_delta, dt_now, dt_ts, dt_ts_def, dt_ts, dt_ts_def, dt_ts_none, dt_utc, format_date,
dt_ts_none, dt_utc, format_date, format_ms_time, format_ms_time, shorten_date)
shorten_date)
from freqtrade.util.formatters import decimals_per_coin, fmt_coin, round_value from freqtrade.util.formatters import decimals_per_coin, fmt_coin, round_value
from freqtrade.util.ft_precise import FtPrecise from freqtrade.util.ft_precise import FtPrecise
from freqtrade.util.measure_time import MeasureTime from freqtrade.util.measure_time import MeasureTime
@ -12,7 +11,6 @@ from freqtrade.util.template_renderer import render_template, render_template_wi
__all__ = [ __all__ = [
'dt_floor_day', 'dt_floor_day',
'dt_from_ts', 'dt_from_ts',
'dt_humanize',
'dt_humanize_delta', 'dt_humanize_delta',
'dt_now', 'dt_now',
'dt_ts', 'dt_ts',

View File

@ -2,7 +2,6 @@ import re
from datetime import datetime, timezone from datetime import datetime, timezone
from typing import Optional, Union from typing import Optional, Union
import arrow
import humanize import humanize
from freqtrade.constants import DATETIME_PRINT_FORMAT from freqtrade.constants import DATETIME_PRINT_FORMAT
@ -84,15 +83,6 @@ def dt_humanize_delta(dt: datetime):
return humanize.naturaltime(dt) return humanize.naturaltime(dt)
def dt_humanize(dt: datetime, **kwargs) -> str:
"""
Return a humanized string for the given datetime.
:param dt: datetime to humanize
:param kwargs: kwargs to pass to arrow's humanize()
"""
return arrow.get(dt).humanize(**kwargs)
def format_date(date: Optional[datetime]) -> str: def format_date(date: Optional[datetime]) -> str:
""" """
Return a formatted date string. Return a formatted date string.