Compare commits

..

2 Commits

Author SHA1 Message Date
n 9784a9ccba
add Gitea CI
lint / lint (push) Successful in 35s Details
2024-02-15 21:30:26 +01:00
n fb726f6cca
pylint fixes 2024-02-15 21:30:26 +01:00
1 changed files with 6 additions and 6 deletions

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python
''' fetch (almost) all blog posts from Dotclear database and export them in Markdown format '''
''' TODO: use rss/atom feed instead '''
''' TODO: convert to proper Gemtext '''
'''fetch (almost) all blog posts from Dotclear database and export them in Markdown format
TODO: use rss/atom feed instead
TODO: convert to proper Gemtext'''
import os
import re
@ -39,11 +39,11 @@ with open("index.gmi", "w", encoding="utf-8") as f:
for x in myresult:
path = path_regex.findall(x[0])[0]
filename = filename_regex.findall(x[0])[0]
path_with_dashes = path.replace("/","-")
filename = quote(quote(filename_regex.findall(x[0])[0]))
with open("index.gmi", "a", encoding="utf-8") as f:
f.write('=> {0}/{1}.gmi {2} - {3}\n'
.format(path, quote(quote(filename)), path.replace("/","-"), x[1]))
f.write(f'=> {path}/{filename}.gmi {path_with_dashes} - {x[1]}\n')
try:
if not os.path.exists(path):