|
|
@@ -6,9 +6,10 @@ from pathlib import Path |
|
|
|
from time import perf_counter |
|
|
|
|
|
|
|
import markdown |
|
|
|
import minicli |
|
|
|
from jinja2 import Environment as Env |
|
|
|
from jinja2 import FileSystemLoader |
|
|
|
from minicli import cli, run, wrap |
|
|
|
from usine import connect, run |
|
|
|
|
|
|
|
HERE = Path(".") |
|
|
|
FAMILLE = HERE / "famille" |
|
|
@@ -39,14 +40,21 @@ def collection(): |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
@cli |
|
|
|
@minicli.cli |
|
|
|
def generate(): |
|
|
|
template = environment.get_template("histoire.html") |
|
|
|
page = template.render(chapters=collection()) |
|
|
|
open(FAMILLE / "histoire" / "index.html", "w").write(page) |
|
|
|
|
|
|
|
|
|
|
|
@wrap |
|
|
|
@minicli.cli |
|
|
|
def deploy(): |
|
|
|
repository = "gitea-repositories/davidbgk/larlet-fr-famille.git" |
|
|
|
run(f"git archive --remote={repository} master | tar -x -C larlet-fr/famille") |
|
|
|
print("Deployment done.") |
|
|
|
|
|
|
|
|
|
|
|
@minicli.wrap |
|
|
|
def perf_wrapper(): |
|
|
|
start = perf_counter() |
|
|
|
yield |
|
|
@@ -55,4 +63,5 @@ def perf_wrapper(): |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
|
run() |
|
|
|
with connect(hostname="larlet@ssh-larlet.alwaysdata.net"): |
|
|
|
minicli.run() |