Update UI.py and UtilPack.py
This commit is contained in:
19
UtilPack.py
19
UtilPack.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user