|
|
|
|
|
|
|
|
from time import perf_counter |
|
|
from time import perf_counter |
|
|
|
|
|
|
|
|
import markdown |
|
|
import markdown |
|
|
|
|
|
import minicli |
|
|
from jinja2 import Environment as Env |
|
|
from jinja2 import Environment as Env |
|
|
from jinja2 import FileSystemLoader |
|
|
from jinja2 import FileSystemLoader |
|
|
from minicli import cli, run, wrap |
|
|
|
|
|
|
|
|
from usine import connect, run |
|
|
|
|
|
|
|
|
HERE = Path(".") |
|
|
HERE = Path(".") |
|
|
FAMILLE = HERE / "famille" |
|
|
FAMILLE = HERE / "famille" |
|
|
|
|
|
|
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cli |
|
|
|
|
|
|
|
|
@minicli.cli |
|
|
def generate(): |
|
|
def generate(): |
|
|
template = environment.get_template("histoire.html") |
|
|
template = environment.get_template("histoire.html") |
|
|
page = template.render(chapters=collection()) |
|
|
page = template.render(chapters=collection()) |
|
|
open(FAMILLE / "histoire" / "index.html", "w").write(page) |
|
|
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(): |
|
|
def perf_wrapper(): |
|
|
start = perf_counter() |
|
|
start = perf_counter() |
|
|
yield |
|
|
yield |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__": |
|
|
if __name__ == "__main__": |
|
|
run() |
|
|
|
|
|
|
|
|
with connect(hostname="larlet@ssh-larlet.alwaysdata.net"): |
|
|
|
|
|
minicli.run() |