-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0090404
commit fa18f97
Showing
26 changed files
with
220 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from .glacialTtsDataMapperInterface import GlacialTtsDataMapperInterface | ||
from ...misc import utils as utils | ||
from ...tts.ttsProvider import TtsProvider | ||
|
||
|
||
class GlacialTtsDataMapper(GlacialTtsDataMapperInterface): | ||
|
||
async def fromDatabaseName(self, ttsProvider: str) -> TtsProvider: | ||
if not utils.isValidStr(ttsProvider): | ||
raise TypeError(f'ttsProvider argument is malformed: \"{ttsProvider}\"') | ||
|
||
ttsProvider = ttsProvider.lower() | ||
|
||
match ttsProvider: | ||
case 'dec_talk': return TtsProvider.DEC_TALK | ||
case 'google': return TtsProvider.GOOGLE | ||
case 'half_life': return TtsProvider.HALF_LIFE | ||
case 'microsoft_sam': return TtsProvider.MICROSOFT_SAM | ||
case 'singing_dec_talk': return TtsProvider.SINGING_DEC_TALK | ||
case 'stream_elements': return TtsProvider.STREAM_ELEMENTS | ||
case 'tts_monster': return TtsProvider.TTS_MONSTER | ||
case _: raise ValueError(f'Encountered unknown TtsProvider value: \"{ttsProvider}\"') | ||
|
||
async def toDatabaseName(self, ttsProvider: TtsProvider) -> str: | ||
match ttsProvider: | ||
case TtsProvider.DEC_TALK: return 'dec_talk' | ||
case TtsProvider.GOOGLE: return 'google' | ||
case TtsProvider.HALF_LIFE: return 'half_life' | ||
case TtsProvider.MICROSOFT_SAM: return 'microsoft_sam' | ||
case TtsProvider.SINGING_DEC_TALK: return 'singing_dec_talk' | ||
case TtsProvider.STREAM_ELEMENTS: return 'stream_elements' | ||
case TtsProvider.TTS_MONSTER: return 'tts_monster' | ||
case _: raise ValueError(f'Encountered unknown TtsProvider value: \"{ttsProvider}\"') |
14 changes: 14 additions & 0 deletions
14
src/glacialTtsStorage/mapper/glacialTtsDataMapperInterface.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
from ...tts.ttsProvider import TtsProvider | ||
|
||
|
||
class GlacialTtsDataMapperInterface(ABC): | ||
|
||
@abstractmethod | ||
async def fromDatabaseName(self, ttsProvider: str) -> TtsProvider: | ||
pass | ||
|
||
@abstractmethod | ||
async def toDatabaseName(self, ttsProvider: TtsProvider) -> str: | ||
pass |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/storage/psqlCredentialsProvider.py → src/storage/psql/psqlCredentialsProvider.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...orage/psqlCredentialsProviderInterface.py → .../psql/psqlCredentialsProviderInterface.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.