Files
chatgpt-on-wechat/common/tmp_dir.py
2023-04-09 17:37:19 +08:00

20 lines
419 B
Python

import os
import pathlib
from config import conf
class TmpDir(object):
"""A temporary directory that is deleted when the object is destroyed.
"""
tmpFilePath = pathlib.Path('./tmp/')
def __init__(self):
pathExists = os.path.exists(self.tmpFilePath)
if not pathExists:
os.makedirs(self.tmpFilePath)
def path(self):
return str(self.tmpFilePath) + '/'