Commit a1aa938d authored by Romain Casati's avatar Romain Casati
Browse files

Use of pathlib in instead of os.path.

parent 3cd92445
#!/usr/bin/env python3
import urllib
import os
from pathlib import Path
AUTHOR = 'Romain Casati'
SITENAME = 'Basthon'
......@@ -66,7 +66,7 @@ def galerie(*args):
def url(file, aux):
url = os.path.join("examples", file)
url = Path("examples") / file
domain = 'console' if file.endswith('.py') else 'notebook'
url = "https://{}{}".format(domain, urllib.parse.quote(url))
if aux is not None:
......@@ -74,7 +74,7 @@ def galerie(*args):
return url
return "".join(one_img.format(SITEURL=SITEURL,
url=url(file, data.get('aux')))
for file, data in examples.items())
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment