From 2709888f2d5b388a7ef1596745fefb320c7ec4b2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Mar 2024 14:54:00 +1100 Subject: [PATCH] Cleanup: de-duplicate date assignment Use the same format when there is no build-info available. --- doc/python_api/conf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/python_api/conf.py b/doc/python_api/conf.py index ce5702dd16e..02f95930ae2 100644 --- a/doc/python_api/conf.py +++ b/doc/python_api/conf.py @@ -10,18 +10,20 @@ BLENDER_VERSION_STRING = "${BLENDER_VERSION_STRING}" BLENDER_VERSION_DOTS = "${BLENDER_VERSION_DOTS}" BLENDER_REVISION = "${BLENDER_REVISION}" BLENDER_REVISION_TIMESTAMP = "${BLENDER_REVISION_TIMESTAMP}" +BLENDER_VERSION_DATE = time.strftime( + "%d/%m/%Y", + time.localtime(BLENDER_REVISION_TIMESTAMP if BLENDER_REVISION_TIMESTAMP != "0" else None), +) if BLENDER_REVISION != "Unknown": # SHA1 GIT hash. BLENDER_VERSION_HASH = BLENDER_REVISION BLENDER_VERSION_HASH_HTML_LINK = "%s" % ( BLENDER_VERSION_HASH, BLENDER_VERSION_HASH) - BLENDER_VERSION_DATE = time.strftime("%d/%m/%Y", time.localtime(BLENDER_REVISION_TIMESTAMP)) else: # Fallback: Should not be used. BLENDER_VERSION_HASH = "Hash Unknown" BLENDER_VERSION_HASH_HTML_LINK = BLENDER_VERSION_HASH - BLENDER_VERSION_DATE = time.strftime("%Y-%m-%d") extensions = ["sphinx.ext.intersphinx"] intersphinx_mapping = {"blender_manual": ("https://docs.blender.org/manual/en/dev/", None)}