Update UI.py and UtilPack.py

This commit is contained in:
2024-12-03 01:00:05 +09:00
parent 3d1c2a8c3d
commit 1e59aefafa
2 changed files with 35 additions and 8 deletions

View File

@@ -1,11 +1,14 @@
import os
import time
import uuid
import rarfile
import zipfile
import shutil
import difflib
import subprocess
from pathlib import Path
m_dbgLevel = 0
listDbgStr = []
@@ -270,5 +273,19 @@ def PrintJSONTree(data, indent=0):
PrintJSONTree(item, indent)
else:
print(' ' * indent + str(data))
def IsPathWithin(base_path: str, target_path: str) -> bool:
base = Path(base_path).resolve()
target = Path(target_path).resolve()
return target.is_relative_to(base)
# 랜덤 UUID 생성
def UUIDGenRandom():
random_uuid = uuid.uuid4()
return random_uuid
# 이름을 기반으로 UUID 생성
def UUIDGenName(SeedName):
namespace_uuid = uuid.uuid5(uuid.NAMESPACE_DNS, SeedName)
return namespace_uuid