no encoding error

master
ioanatomici 5 years ago
parent 0b29abe5b7
commit 25092cb9dd

@ -34,7 +34,6 @@ with open('login.txt', 'r') as login: # read login user & pwd
SLASH = "\u2044"
HYPHEN = "\u2010"
def filenameforpage(p):
@ -45,7 +44,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).replace('', HYPHEN) + '.html'
href = href.replace(' ','_').replace('/', SLASH) + '.html'
href = urlquote(href)
return href
@ -102,7 +101,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:
print(html, file=f)
pass
# print(html, file=f)
if args.one:
break

Loading…
Cancel
Save