initial commit for uploading just maps over a VM to OVH

This commit is contained in:
jenz
2022-10-20 00:37:58 +02:00
parent 3316b6e74a
commit 0cf47b8e6c
8 changed files with 243 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
from pathlib import Path
import contextlib
import os
class local_dir_remote:
def __init__(self, config):
self.config = config
self.path = config["path"]
def list_dir(self):
path = Path(self.path)
glob_pattern = '*'
return list(path.glob(glob_pattern))
def delete_local_map(self, pathfile):
with contextlib.suppress(FileNotFoundError):
if str(pathfile).endswith('.bsp'):
os.remove(pathfile)