Git hash is now also in.

This commit is contained in:
2023-04-26 15:52:09 +02:00
parent a5d767baeb
commit 14f7f5c6ac

View File

@@ -24,6 +24,9 @@
# DO NOT REMOVE THIS PREAMBLE !!!
#
import time
import pathlib
#
#
@@ -47,20 +50,25 @@ globvar_configfile_path = "./AFM_thumbs/"
#
#
# _____________________________________________________________________ to here
#
#
#
# ____________________________________________________________ Git hash version
# Get the git hash version
def get_git_revision(base_path):
git_dir = pathlib.Path(base_path) / '.git'
with (git_dir / 'HEAD').open('r') as head:
ref = head.readline().split(' ')[-1].strip()
with (git_dir / ref).open('r') as git_hash:
return git_hash.readline().strip()
# ____________________________________________________________ Global variables
# DO NOT CHANGE ANYTHING BELOW, OTHERWISE YOU KNOW WHAT TO DO !
import time
globvar_contributions = "Reinhard Olbrich (testing)\n" \
"Matthias Temmen (testing)\n" \
"Alexander v Schmidtsfeld (testing)\n" \
@@ -68,6 +76,7 @@ globvar_contributions = "Reinhard Olbrich (testing)\n" \
globvar_year = "2023-04-26"
globvar_version = "3.0.1111"
globvar_git_version = get_git_revision(os.path.join(os.path.dirname(__file__), "../"))
globvar_spaces = " "
globvar_name = "AFM thumbs v" + globvar_version
@@ -89,6 +98,7 @@ globvar_console = ("\n\n"+
globvar_spaces +
globvar_name + " - " +
globvar_year + "\n" +
"GIT commit: " + globvar_git_version + "\n" +
globvar_spaces + "www.root-1.de\n\n" +
globvar_spaces + "Today: " +
time.strftime("%d-%m-%Y") +