This commit is contained in:
Marc Beninca 2025-02-18 21:16:35 +01:00
parent 3dacff41a5
commit 2a32fee946
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

15
sync.py
View file

@ -1,5 +1,6 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
from logging import log
import os import os
import subprocess import subprocess
@ -60,7 +61,7 @@ def sync(root, pubnix, exclude=None):
"--partial", "--partial",
"--progress", "--progress",
"--verbose", "--verbose",
os.path.join(root, str()), os.path.join(root, ""),
] ]
for item in exclude: for item in exclude:
args.extend(["--exclude", os.path.join(str(), item)]) args.extend(["--exclude", os.path.join(str(), item)])
@ -71,14 +72,10 @@ def sync(root, pubnix, exclude=None):
def main(): def main():
root = os.path.dirname(os.path.realpath(__file__)) root = os.path.dirname(os.path.realpath(__file__))
root = os.path.join(root, "out", "web") root = os.path.join(root, "out", "web")
dns_length = max([len(pubnix.dn) for pubnix in PUBNIXES]) for pn in PUBNIXES:
for pubnix in PUBNIXES: log()
print() log(pn)
print(pubnix) sync(root, pn, exclude=["__pycache__", "pgp.asc"])
# print(f'{pubnix.dn.rjust(dns_length)} → ', end=str(), flush=True)
sync(root, pubnix, exclude=["__pycache__", "pgp.asc"])
# print(pubnix.disk_free())
# print(pubnix.os())
if __name__ == "__main__": if __name__ == "__main__":