You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
382B

  1. import os
  2. import pathlib
  3. class TmpDir(object):
  4. """A temporary directory that is deleted when the object is destroyed."""
  5. tmpFilePath = pathlib.Path("./tmp/")
  6. def __init__(self):
  7. pathExists = os.path.exists(self.tmpFilePath)
  8. if not pathExists:
  9. os.makedirs(self.tmpFilePath)
  10. def path(self):
  11. return str(self.tmpFilePath) + "/"