Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make configuration handling a lot better #141

Merged
merged 19 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9f253ef
add preliminary support for more advanced configuration options in od…
albertotirla Mar 14, 2024
d59c338
refactor state a bit, to create config.toml from scratch based on def…
albertotirla Mar 14, 2024
4cf5948
refactor State::new to use figment directly
albertotirla Mar 16, 2024
dc5e613
make configuration be working from main, instead of state::new and ma…
albertotirla Mar 16, 2024
cff540b
fix: screenreader applies configuration properly
albertotirla Mar 19, 2024
7600df9
honor configuration when setting the speech rate
albertotirla Mar 19, 2024
9eef0b4
env: attempt to parse nested configuration
albertotirla Mar 19, 2024
be121fb
refactor: move loading of configuration in its own function
albertotirla Mar 31, 2024
fca8ce5
remove environment variable configuration, as it's not working with o…
albertotirla Apr 24, 2024
d06af70
fix clippy warning
albertotirla Apr 25, 2024
666803d
fix configuration again not joining properly
albertotirla Apr 25, 2024
1fc4404
make logging subsystem use the logging level provided in the configur…
albertotirla Apr 25, 2024
744a2cf
allow odilia to accept a log file and use it to log information, same…
albertotirla Apr 25, 2024
1f5d5aa
add pitch to the configuration
albertotirla Apr 25, 2024
981091a
add volume configuration
albertotirla Apr 25, 2024
22f3ad7
make output module configurable and run the formatter a bit
albertotirla Apr 25, 2024
068c80e
add language and voice to the configuration
albertotirla Apr 25, 2024
4aca3a3
make punctuation reporting configurable
albertotirla Apr 25, 2024
949a72d
fix formatting
albertotirla Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 165 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ bitflags = "1.3.2"
serde = "1.0.147"
smartstring = "1.0.1"
thiserror = "1.0.37"
tini = "^1.3.0"
zbus.workspace = true
serde_plain.workspace = true
figment = "0.10.15"
10 changes: 5 additions & 5 deletions common/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ pub enum OdiliaError {
}
#[derive(Debug)]
pub enum ConfigError {
Tini(tini::Error),
Figment(figment::Error),
ValueNotFound,
PathNotFound,
}
impl From<tini::Error> for ConfigError {
fn from(t_err: tini::Error) -> Self {
Self::Tini(t_err)
impl From<figment::Error> for ConfigError {
fn from(t_err: figment::Error) -> Self {
Self::Figment(t_err)
}
}
impl std::fmt::Display for ConfigError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Tini(t) => t.fmt(f),
Self::Figment(t) => t.fmt(f),
Self::ValueNotFound => f.write_str("Vlaue not found in config file."),
Self::PathNotFound => {
f.write_str("The path for the config file was not found.")
Expand Down
Loading