Include version/date in changelog

This commit is contained in:
Matt 2020-08-07 14:51:03 -04:00
parent d839b3a60a
commit 564982919d

View file

@ -2,6 +2,7 @@ import xml.etree.ElementTree as ET
import yaml import yaml
import sys import sys
import os import os
from datetime import datetime
def indent(elem, level=0): def indent(elem, level=0):
''' '''
@ -52,11 +53,12 @@ addon_version = data.get('version')
root.attrib['version'] = f'{addon_version}-{py_version}' root.attrib['version'] = f'{addon_version}-{py_version}'
# Changelog # Changelog
date = datetime.today().strftime('%Y-%m-%d')
changelog = data.get('changelog') changelog = data.get('changelog')
for section in root.findall('extension'): for section in root.findall('extension'):
news = section.findall('news') news = section.findall('news')
if news: if news:
news[0].text = f'Changelog:\n{changelog}' news[0].text = f'v{addon_version} ({date}):\n{changelog}'
# Format xml tree # Format xml tree
indent(root) indent(root)