From: Scott Gasch Date: Mon, 21 Mar 2022 18:45:22 +0000 (-0700) Subject: Small changes. X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=fdfbe2d80c21f36083065899c37f777e6cf2a138;p=python_utils.git Small changes. --- 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