Refactor: templates to format copyright year 13/67813/3
authorGuillaume Lambert <guillaume.lambert@orange.com>
Tue, 25 May 2021 19:57:03 +0000 (21:57 +0200)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Wed, 26 May 2021 13:23:15 +0000 (15:23 +0200)
Up to now, the copyright year was hardcoded in every project template
and had to be updated regularly.
To avoid manual updates and new versions of lfdocs-conf in Pypi,
it is preferable to use python3 datetime import with the format method
to fill and update the year automatically.

Signed-off-by: Guillaume Lambert <guillaume.lambert@orange.com>
Change-Id: I35a7551a80be470dff5b55e0cabb4944a9bab02c

docs_conf/conf.py
docs_conf/defaults/default.yaml
docs_conf/defaults/lfdocs.yaml
docs_conf/defaults/onap.yaml
docs_conf/defaults/opendaylight.yaml
docs_conf/defaults/opnfv.yaml
docs_conf/defaults/oran.yaml

index d84f2ea..0a62067 100644 (file)
@@ -14,6 +14,7 @@
 Configure sphinx-doc through an YAML file.
 """
 
+import datetime
 import imp
 import os.path
 
@@ -78,7 +79,7 @@ project = cfg.get("project")
 version = cfg.get("version")
 release = cfg.get("release", version)
 author = cfg.get("author")
-copyright = cfg.get("copyright")
+copyright = cfg.get("copyright").format(datetime.datetime.now().year)
 
 needs_sphinx = cfg.get("needs_sphinx", "1.0")
 exclude_patterns = cfg.get("exclude_patterns", [])
index 1a0dbcc..f95b094 100644 (file)
@@ -3,7 +3,7 @@ project: DEFAULT_PROJECT
 release: master
 version: master
 author: DEFAULT_AUTHOR
-copyright: 2018, DEFAULT_PROJECT
+copyright: "{}, DEFAULT_PROJECT"
 
 needs_sphinx: "1.6.5"
 extensions:
index 578ecd9..1a99b03 100644 (file)
@@ -3,7 +3,7 @@ project: lf-releng-docs
 release: master
 version: master
 author: Linux Foundation Releng
-copyright: 2017-2018, The Linux Foundation
+copyright: "2017-{}, The Linux Foundation"
 
 needs_sphinx: "1.6.5"
 extensions:
index 115d3e5..0c005c2 100644 (file)
@@ -5,7 +5,7 @@ version: master
 
 author: "Open Network Automation Platform"
 # yamllint disable-line rule:line-length
-copyright: "2021 ONAP. Licensed under Creative Commons Attribution 4.0 International License"
+copyright: "{} ONAP. Licensed under Creative Commons Attribution 4.0 International License"
 
 pygments_style: "sphinx"
 html_theme: sphinx_rtd_theme
index 09fd92c..40b4665 100644 (file)
@@ -3,7 +3,7 @@ project: OpenDaylight
 release: master
 version: master
 author: OpenDaylight Project
-copyright: 2016-2021, OpenDaylight Project
+copyright: "2016-{}, OpenDaylight Project"
 
 needs_sphinx: "1.6.5"
 extensions:
index 1014f13..6979a3a 100644 (file)
@@ -3,7 +3,7 @@ project: OPNFV
 release: Latest
 version: Latest
 author: Open Platform for NFV
-copyright: 2020, OPNFV. Licensed under CC BY 4.0
+copyright: "{}, OPNFV. Licensed under CC BY 4.0"
 
 needs_sphinx: "1.3"
 extensions:
index 7fddb5e..da3f033 100644 (file)
@@ -3,7 +3,7 @@ project: ORAN
 release: master
 version: master
 author: O-RAN Project
-copyright: 2019, O-RAN Project
+copyright: "{}, O-RAN Project"
 
 needs_sphinx: "1.6.5"
 extensions: