Skip to content
Snippets Groups Projects
Commit 03f2b5ee authored by akwizgran's avatar akwizgran
Browse files

Migrate build.py to Python 3.

parent 1ac1806f
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python #!/usr/bin/python3
import os import os
import requests import requests
...@@ -13,7 +13,7 @@ def checkAtom(file): ...@@ -13,7 +13,7 @@ def checkAtom(file):
r = requests.post(url, data=payload) r = requests.post(url, data=payload)
if "This is a valid Atom 1.0 feed" in r.content: if "This is a valid Atom 1.0 feed" in r.content.decode():
return "checkAtom: " + file + " is valid" return "checkAtom: " + file + " is valid"
else: else:
return "checkAtom: " + file + " is NOT valid" return "checkAtom: " + file + " is NOT valid"
...@@ -26,7 +26,7 @@ def checkHtml(file): ...@@ -26,7 +26,7 @@ def checkHtml(file):
r = requests.post(url, files=files) r = requests.post(url, files=files)
if "The document validates" in r.content: if "The document validates" in r.content.decode():
return "checkHtml: " + file + " is valid" return "checkHtml: " + file + " is valid"
else: else:
return "checkHtml: " + file + " is NOT valid" return "checkHtml: " + file + " is NOT valid"
...@@ -34,6 +34,6 @@ def checkHtml(file): ...@@ -34,6 +34,6 @@ def checkHtml(file):
if __name__ == "__main__": if __name__ == "__main__":
os.system('hugo --cleanDestinationDir') os.system('hugo --cleanDestinationDir')
atom = checkAtom('public/index.xml') atom = checkAtom('public/index.xml')
print atom print(atom)
html = checkHtml('public/index.html') html = checkHtml('public/index.html')
print html print(html)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment