PathParam.py 823 B

123456789101112131415161718192021222324252627
  1. import os
  2. class PathParam(object):
  3. def __init__(self, tmp_root, exector_process_dir_name, read_dir):
  4. self.tmp_base_path = str(os.path.join(tmp_root, exector_process_dir_name))
  5. self.read_dir = read_dir
  6. def get_unzip_tmp_path(self):
  7. path = os.path.join(self.tmp_base_path, 'unzip_tmp')
  8. if not os.path.exists(path):
  9. os.makedirs(path, exist_ok=True)
  10. return path
  11. def get_process_tmp_path(self):
  12. path = os.path.join(self.tmp_base_path, 'process_tmp')
  13. if not os.path.exists(path):
  14. os.makedirs(path, exist_ok=True)
  15. return path
  16. def get_merge_tmp_path(self):
  17. path = os.path.join(self.tmp_base_path, 'merge_tmp')
  18. if not os.path.exists(path):
  19. os.makedirs(path, exist_ok=True)
  20. return path