Clean HTML for admin site

This commit is contained in:
2026-05-22 01:21:39 +02:00
committed by kitoy
parent 852d680b15
commit 7ee91198ef
5 changed files with 52 additions and 55 deletions

View File

@@ -189,24 +189,23 @@ class DataSite:
pageIndex.write_text(htmlExport)
def copy_static_files(self):
themesStaticFolder = Path(PurePosixPath('app').joinpath('static','themes', self.datas['config']['theme'],'static'))
publicStaticFolder = Path(PurePosixPath(self.user_folder).joinpath('public', 'static'))
themesStaticFolder = Path(PurePosixPath('app').joinpath('static','themes', self.datas['config']['theme']))
publicStaticFolder = Path(PurePosixPath(self.user_folder).joinpath('public', 'static', 'themes', self.datas['config']['theme']))
rmtree (publicStaticFolder, ignore_errors=True)
copytree(themesStaticFolder, publicStaticFolder)
def publish(self, user:str, password:str, serverAddress:str, serverPort:int, folder:str):
remote_directory = "/remote/dir"
userDir = Path(PurePosixPath(self.user_folder))
command = "lftp -u \"{}\",\"{}\" -p {} {} -e ' mirror -R public {}; chmod -R o+rx ./; bye;'".format(user,
password,
serverPort,
serverAddress,
folder)
print(command)
folder)
try:
subprocess.call(command, shell=True, cwd=str(userDir))
except ChildProcessError: