From fdfbe2d80c21f36083065899c37f777e6cf2a138 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Mon, 21 Mar 2022 11:45:22 -0700 Subject: [PATCH] Small changes. --- arper.py | 2 +- constants.py | 29 ++++++++++++----------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/arper.py b/arper.py index 2ef2676..4f362f4 100644 --- a/arper.py +++ b/arper.py @@ -41,7 +41,7 @@ cfg.add_argument( cfg.add_argument( '--arper_cache_max_staleness', type=argparse_utils.valid_duration, - default=datetime.timedelta(seconds=60 * 15), + default=datetime.timedelta(seconds=60 * 30), metavar='DURATION', help='Max acceptable age of the kernel arp table cache', ) diff --git a/constants.py b/constants.py index fdc533b..934edb2 100644 --- a/constants.py +++ b/constants.py @@ -2,24 +2,19 @@ """Universal constants.""" +from typing import Final + # This module is commonly used by others in here and should avoid # taking any unnecessary dependencies back on them. # Date/time based constants -SECONDS_PER_MINUTE = 60 -SECONDS_PER_HOUR = 60 * SECONDS_PER_MINUTE -SECONDS_PER_DAY = 24 * SECONDS_PER_HOUR -SECONDS_PER_WEEK = 7 * SECONDS_PER_DAY -MINUTES_PER_HOUR = 60 -MINUTES_PER_DAY = 24 * MINUTES_PER_HOUR -MINUTES_PER_WEEK = 7 * MINUTES_PER_DAY -HOURS_PER_DAY = 24 -HOURS_PER_WEEK = 7 * HOURS_PER_DAY -DAYS_PER_WEEK = 7 -DATETIME_WEEKDAY_MONDAY = 0 -DATETIME_WEEKDAY_TUEDAY = 0 -DATETIME_WEEKDAY_WEDNESDAY = 0 -DATETIME_WEEKDAY_THURSDAY = 0 -DATETIME_WEEKDAY_FRIDAY = 0 -DATETIME_WEEKDAY_SATURDAY = 0 -DATETIME_WEEKDAY_SUNDAY = 0 +SECONDS_PER_MINUTE: Final = 60 +SECONDS_PER_HOUR: Final = 60 * SECONDS_PER_MINUTE +SECONDS_PER_DAY: Final = 24 * SECONDS_PER_HOUR +SECONDS_PER_WEEK: Final = 7 * SECONDS_PER_DAY +MINUTES_PER_HOUR: Final = 60 +MINUTES_PER_DAY: Final = 24 * MINUTES_PER_HOUR +MINUTES_PER_WEEK: Final = 7 * MINUTES_PER_DAY +HOURS_PER_DAY: Final = 24 +HOURS_PER_WEEK: Final = 7 * HOURS_PER_DAY +DAYS_PER_WEEK: Final = 7 -- 2.47.1