Don't use f-strings (yet)

This commit is contained in:
Odd Stråbø 2020-09-27 05:40:30 +02:00
parent 6d61a83b54
commit 770ca74a07
1 changed files with 4 additions and 4 deletions

View File

@ -35,12 +35,12 @@ except IndexError:
dir_path = os.path.dirname(os.path.realpath(__file__)) dir_path = os.path.dirname(os.path.realpath(__file__))
# Load template file # Load template file
with open(f'{dir_path}/template.xml', 'r') as f: with open('{dir_path}/template.xml'.format(**locals()), 'r') as f:
tree = ET.parse(f) tree = ET.parse(f)
root = tree.getroot() root = tree.getroot()
# Load version dependencies # Load version dependencies
with open(f'{dir_path}/{py_version}.yaml', 'r') as f: with open('{dir_path}/{py_version}.yaml'.format(**locals()), 'r') as f:
deps = yaml.safe_load(f) deps = yaml.safe_load(f)
# Load version and changelog # Load version and changelog
@ -53,7 +53,7 @@ for dep in deps:
# Update version string # Update version string
addon_version = data.get('version') addon_version = data.get('version')
root.attrib['version'] = f'{addon_version}+{py_version}' root.attrib['version'] = '{addon_version}+{py_version}'.format(**locals())
# Changelog # Changelog
date = datetime.today().strftime('%Y-%m-%d') date = datetime.today().strftime('%Y-%m-%d')
@ -61,7 +61,7 @@ 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'v{addon_version} ({date}):\n{changelog}' news[0].text = 'v{addon_version} ({date}):\n{changelog}'.format(**locals())
# Format xml tree # Format xml tree
indent(root) indent(root)