Git hash is now also in.
This commit is contained in:
@@ -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
|
||||
@@ -85,14 +94,15 @@ globvar_note = ("Version " + globvar_version + " (" +
|
||||
"Contributions from:\n" +
|
||||
globvar_contributions)
|
||||
|
||||
globvar_console = ("\n\n"+
|
||||
globvar_spaces +
|
||||
globvar_name + " - " +
|
||||
globvar_year + "\n" +
|
||||
globvar_spaces + "www.root-1.de\n\n" +
|
||||
globvar_spaces + "Today: " +
|
||||
time.strftime("%d-%m-%Y") +
|
||||
", Time: " +
|
||||
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") +
|
||||
", Time: " +
|
||||
time.strftime("%H:%M:%S"))
|
||||
|
||||
globvar_python_directory = "AFM_thumbs"
|
||||
|
||||
Reference in New Issue
Block a user