INNER CODE UNIT · Python
days_diff
rfc-st/humble · humble.py:310
days_diff = (github_version - local_version).days
check_updates_diff(days_diff, github_version, local_version)
except (requests.exceptions.RequestException, ValueError):
print_error_detail("[update_error]")
sys.exit(0)
def check_updates_diff(days_diff, github_version, local_version):
"""`humble` update logic.
Check whether the local version is more than a month older than the latest
on GitHub, related to `-v` option.
"""
print(f" \n{STYLE[0]}{get_detail('[humble_latest]', replace=True)} \
{github_version} \n {get_detail('[humble_local]', replace=True)} \
{local_version}{STYLE[4]}")
if days_diff > DAYS_DIFF:
print(f"\n{get_detail('[humble_not_recent]')}\n\