From ee66db5dc94cdae26fe45bd4dce7ca2824cf1c0c Mon Sep 17 00:00:00 2001 From: junboli Date: Sat, 9 Sep 2017 23:01:08 +0800 Subject: [PATCH] Fix html_last_updated_fmt in conf.py 1. remove duplicate html_last_updated_fmt in doc/source/conf.py the second one cause the new added one not take effect. 2. update html_last_updated_fmt in api-ref/source/conf.py use the recommended '%Y-%m-%d %H:%M' data time format. Change-Id: Ib37b8a05c88667b34438186c55b6eb3f64b64960 --- api-ref/source/conf.py | 10 +--------- doc/source/conf.py | 9 --------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index ed5e70b70f..83e22cc09c 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -23,9 +23,7 @@ # serve to show the default. import os -import subprocess import sys -import warnings import openstackdocstheme @@ -174,13 +172,7 @@ todo_include_todos = False # If not None, a 'Last updated on:' timestamp is inserted at every page # bottom, using the given strftime format. # The empty string is equivalent to '%b %d, %Y'. -git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", - "-n1"] -try: - html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8') -except Exception: - warnings.warn('Cannot get last updated time from git repository. ' - 'Not setting "html_last_updated_fmt".') +html_last_updated_fmt = '%Y-%m-%d %H:%M' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. diff --git a/doc/source/conf.py b/doc/source/conf.py index 5d6dffb993..52b9d5d7d2 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -210,15 +210,6 @@ html_theme_options = {} # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. # html_last_updated_fmt = '%b %d, %Y' -git_cmd = [ - "git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", "-n1" -] -try: - import subprocess - html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8') -except Exception: - warnings.warn('Cannot get last updated time from git repository. ' - 'Not setting "html_last_updated_fmt".') # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities.