-
Notifications
You must be signed in to change notification settings - Fork 957
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
86626aa
commit 474f4c5
Showing
2 changed files
with
82 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import enum | ||
import typing | ||
|
||
from PyQt6.QtCore import QSettings | ||
|
||
APP_NAME = 'Buzz' | ||
|
||
|
||
class Settings: | ||
settings = QSettings(APP_NAME) | ||
|
||
class Key(enum.Enum): | ||
RECORDING_TRANSCRIBER_TASK = 'recording-transcriber/task' | ||
RECORDING_TRANSCRIBER_MODEL = 'recording-transcriber/model' | ||
RECORDING_TRANSCRIBER_LANGUAGE = 'recording-transcriber/language' | ||
RECORDING_TRANSCRIBER_TEMPERATURE = 'recording-transcriber/temperature' | ||
RECORDING_TRANSCRIBER_INITIAL_PROMPT = 'recording-transcriber/initial-prompt' | ||
|
||
FILE_TRANSCRIBER_TASK = 'file-transcriber/task' | ||
FILE_TRANSCRIBER_MODEL = 'file-transcriber/model' | ||
FILE_TRANSCRIBER_LANGUAGE = 'file-transcriber/language' | ||
FILE_TRANSCRIBER_TEMPERATURE = 'file-transcriber/temperature' | ||
FILE_TRANSCRIBER_INITIAL_PROMPT = 'file-transcriber/initial-prompt' | ||
FILE_TRANSCRIBER_WORD_LEVEL_TIMINGS = 'file-transcriber/word-level-timings' | ||
FILE_TRANSCRIBER_EXPORT_FORMATS = 'file-transcriber/export-formats' | ||
|
||
def set_value(self, key: Key, value: typing.Any) -> None: | ||
self.settings.setValue(key.value, value) | ||
|
||
def value(self, key: Key, default_value: typing.Any, value_type: typing.Optional[type] = None) -> typing.Any: | ||
return self.settings.value(key.value, default_value, | ||
value_type if value_type is not None else type(default_value)) |