Terminate base directory from temp helper
This commit is contained in:
parent
516bc0117d
commit
3559f7891a
@ -8,7 +8,6 @@ from facefusion.date_helper import get_current_date_time
|
||||
from facefusion.filesystem import create_directory, is_directory, is_file, move_file, remove_directory, remove_file
|
||||
from facefusion.jobs.job_helper import get_step_output_path
|
||||
from facefusion.json import read_json, write_json
|
||||
from facefusion.temp_helper import create_base_directory
|
||||
from facefusion.typing import Args, Job, JobSet, JobStatus, JobStep, JobStepStatus
|
||||
|
||||
JOBS_PATH : Optional[str] = None
|
||||
@ -20,7 +19,6 @@ def init_jobs(jobs_path : str) -> bool:
|
||||
JOBS_PATH = jobs_path
|
||||
job_status_paths = [ os.path.join(JOBS_PATH, job_status) for job_status in job_statuses ]
|
||||
|
||||
create_base_directory()
|
||||
for job_status_path in job_status_paths:
|
||||
create_directory(job_status_path)
|
||||
return all(is_directory(status_path) for status_path in job_status_paths)
|
||||
|
@ -28,24 +28,9 @@ def get_temp_frames_pattern(target_path : str, temp_frame_prefix : str) -> str:
|
||||
return os.path.join(temp_directory_path, temp_frame_prefix + '.' + state_manager.get_item('temp_frame_format'))
|
||||
|
||||
|
||||
def get_base_directory_path() -> str:
|
||||
return os.path.join(tempfile.gettempdir(), 'facefusion')
|
||||
|
||||
|
||||
def create_base_directory() -> bool:
|
||||
base_directory_path = get_base_directory_path()
|
||||
return create_directory(base_directory_path)
|
||||
|
||||
|
||||
def clear_base_directory() -> bool:
|
||||
base_directory_path = get_base_directory_path()
|
||||
return remove_directory(base_directory_path)
|
||||
|
||||
|
||||
def get_temp_directory_path(file_path : str) -> str:
|
||||
temp_file_name, _ = os.path.splitext(os.path.basename(file_path))
|
||||
base_directory_path = get_base_directory_path()
|
||||
return os.path.join(base_directory_path, temp_file_name)
|
||||
return os.path.join(tempfile.gettempdir(), 'facefusion', temp_file_name)
|
||||
|
||||
|
||||
def create_temp_directory(file_path : str) -> bool:
|
||||
|
@ -1,7 +1,7 @@
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
from facefusion.filesystem import create_directory, is_directory, is_file, remove_directory
|
||||
from facefusion.temp_helper import get_base_directory_path
|
||||
from facefusion.typing import JobStatus
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ def get_test_job_file(file_path : str, job_status : JobStatus) -> str:
|
||||
|
||||
|
||||
def get_test_jobs_directory() -> str:
|
||||
return os.path.join(get_base_directory_path(), 'test-jobs')
|
||||
return os.path.join(tempfile.gettempdir(), 'facefusion-test-jobs')
|
||||
|
||||
|
||||
def get_test_example_file(file_path : str) -> str:
|
||||
@ -22,7 +22,7 @@ def get_test_example_file(file_path : str) -> str:
|
||||
|
||||
|
||||
def get_test_examples_directory() -> str:
|
||||
return os.path.join(get_base_directory_path(), 'test-examples')
|
||||
return os.path.join(tempfile.gettempdir(), 'facefusion-test-examples')
|
||||
|
||||
|
||||
def is_test_output_file(file_path : str) -> bool:
|
||||
@ -34,7 +34,7 @@ def get_test_output_file(file_path : str) -> str:
|
||||
|
||||
|
||||
def get_test_outputs_directory() -> str:
|
||||
return os.path.join(get_base_directory_path(), 'test-outputs')
|
||||
return os.path.join(tempfile.gettempdir(), 'facefusion-test-outputs')
|
||||
|
||||
|
||||
def prepare_test_output_directory() -> bool:
|
||||
|
Loading…
Reference in New Issue
Block a user