From 05f8d52f63849361eb9be205898749cba9f28d4a Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Wed, 23 Jun 2021 16:42:49 +0800 Subject: [PATCH] Update statistics_hook.py --- plugins/statistics_hook.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/statistics_hook.py b/plugins/statistics_hook.py index af5659db..bda696bb 100644 --- a/plugins/statistics_hook.py +++ b/plugins/statistics_hook.py @@ -33,6 +33,15 @@ except (FileNotFoundError, ValueError): 'start_time': str(datetime.now().date()), 'day_index': 0 } +if not _prefix_count_dict.get('day_index'): + tmp = _prefix_count_dict.copy() + _prefix_count_dict = {'total_statistics': tmp['total_statistics'], 'day_statistics': { + 'total': {}, + }, 'week_statistics': { + 'total': {}, + }, 'month_statistics': { + 'total': {}, + }, 'start_time': str(datetime.now().date()), 'day_index': 0} # 添加命令次数