Cache2.py 965 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. class Cache2(object):
  2. def __init__(self):
  3. pass
  4. @classmethod
  5. def get_file_path_from_text(cls, sentence, tts):
  6. """
  7. Get a sentence (a text) an return the full path of the file
  8. Path syntax:
  9. </path/in/settings>/<tts.name>/tts.parameter["language"]/<md5_of_sentence.tts
  10. E.g:
  11. /tmp/kalliope/voxygene/fr/abcd12345.tts
  12. :param sentence:
  13. :param tts: The Tts model instance that contain parameter like language, key, etc...
  14. :type tts: Tts
  15. :return: path String
  16. """
  17. pass
  18. @classmethod
  19. def delete_file(cls, file_path):
  20. """
  21. Delete the file in path <file_path>
  22. :param file_path:
  23. :return:
  24. """
  25. pass
  26. @staticmethod
  27. def _generate_md5_from_text(text):
  28. """
  29. Local function to generate a md5 hash from a string sentence
  30. :param text:
  31. :return: String
  32. """
  33. pass