Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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) + "/"