text wrap

master
km0 3 years ago
parent f3e197cff6
commit afc1c3a16f

@ -76,6 +76,7 @@ def get_recipes():
def update_wiki(recipe): def update_wiki(recipe):
import mwclient import mwclient
import textwrap
site = mwclient.Site('pzwiki.wdka.nl', path='/mw-mediadesign/') site = mwclient.Site('pzwiki.wdka.nl', path='/mw-mediadesign/')
site.login( site.login(
@ -91,7 +92,7 @@ def update_wiki(recipe):
steps+= f'# {log}\n' steps+= f'# {log}\n'
# PROV TEMPLATE # PROV TEMPLATE
content = f""" content = f"""\
=== {recipe['title']} === === {recipe['title']} ===
''{recipe['description']}'' ''{recipe['description']}''
<br> <br>
@ -106,7 +107,7 @@ def update_wiki(recipe):
<br> <br>
{recipe['who']} {recipe['who']}
""" """
text += content text += textwrap.dedent(content)
page.edit(text, f'Added a new recipe! {recipe["title"]}') page.edit(text, f'Added a new recipe! {recipe["title"]}')

Loading…
Cancel
Save