From c0ad1dd62167472ac5977773aaf296076d9cb2c4 Mon Sep 17 00:00:00 2001 From: Castro0o Date: Tue, 7 Apr 2020 18:08:37 +0200 Subject: [PATCH] writing html content to file --- dumpwiki.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dumpwiki.py b/dumpwiki.py index beabf5f..4152757 100644 --- a/dumpwiki.py +++ b/dumpwiki.py @@ -34,6 +34,7 @@ with open('login.txt', 'r') as login: # read login user & pwd SLASH = "\u2044" +HYPHEN = "\u2010" def filenameforpage(p): @@ -44,7 +45,7 @@ def filenameforlink(href): href = urlunquote(href) if href.startswith("/sandbox/itchwiki/index.php/"): href = href[len("/sandbox/itchwiki/index.php/"):] - href = href.replace(' ','_').replace('/', SLASH) + '.html' + href = href.replace(' ','_').replace('/', SLASH).replace('‐', HYPHEN) + '.html' href = urlquote(href) return href @@ -101,8 +102,8 @@ for cat in publish.members(): html = template.render(page=p, body=htmlsrc, staticpath='0') with open(os.path.join(args.output, filenameforpage(p)), 'w') as f: - pass -# print(html, file=f) + f.write(html) + # print(html, file=f) if args.one: break