diff --git a/utils/mkhtml.py b/utils/mkhtml.py index ad2b149997d..6e6b9d54e6c 100644 --- a/utils/mkhtml.py +++ b/utils/mkhtml.py @@ -449,7 +449,8 @@ def get_last_git_commit(src_dir, addon_path, is_addon): """ sourcecode = string.Template( - """

SOURCE CODE

+ """ +

SOURCE CODE

Available at: ${PGM} source code @@ -905,36 +906,39 @@ def to_title(name): if sys.platform == "win32": url_source = url_source.replace(os.path.sep, "/") -if index_name: - branches = "branches" - tree = "tree" - commits = "commits" +# Process Source code section +branches = "branches" +tree = "tree" +commits = "commits" - if branches in url_source: - url_log = url_source.replace(branches, commits) - url_source = url_source.replace(branches, tree) - else: - url_log = url_source.replace(tree, commits) +if branches in url_source: + url_log = url_source.replace(branches, commits) + url_source = url_source.replace(branches, tree) +else: + url_log = url_source.replace(tree, commits) - git_commit = get_last_git_commit( - src_dir=curdir, - addon_path=addon_path if addon_path else None, - is_addon=True if addon_path else False, +git_commit = get_last_git_commit( + src_dir=curdir, + addon_path=addon_path if addon_path else None, + is_addon=True if addon_path else False, +) +if git_commit["commit"] == "unknown": + date_tag = "Accessed: {date}".format(date=git_commit["date"]) +else: + date_tag = "Latest change: {date} in commit: {commit}".format( + date=git_commit["date"], commit=git_commit["commit"] ) - if git_commit["commit"] == "unknown": - date_tag = "Accessed: {date}".format(date=git_commit["date"]) - else: - date_tag = "Latest change: {date} in commit: {commit}".format( - date=git_commit["date"], commit=git_commit["commit"] - ) - sys.stdout.write( - sourcecode.substitute( - URL_SOURCE=url_source, - PGM=pgm, - URL_LOG=url_log, - DATE_TAG=date_tag, - ) +sys.stdout.write( + sourcecode.substitute( + URL_SOURCE=url_source, + PGM=pgm, + URL_LOG=url_log, + DATE_TAG=date_tag, ) +) + +# Process footer +if index_name: sys.stdout.write( footer_index.substitute( INDEXNAME=index_name,