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.

20 lines
464B

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