Ignore deleted tasks
This commit is contained in:
parent
419bac6204
commit
243ebf67b1
3 changed files with 19 additions and 3 deletions
15
home-manager/packages/rust-scripts/src/bin/update_tasks.rs
Normal file
15
home-manager/packages/rust-scripts/src/bin/update_tasks.rs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
extern crate rust_scripts;
|
||||||
|
extern crate task_hookrs;
|
||||||
|
|
||||||
|
use rust_scripts::error::Result;
|
||||||
|
use rust_scripts::update::update_tasks;
|
||||||
|
use task_hookrs::cache::TaskCache;
|
||||||
|
use task_hookrs::status::TaskStatus;
|
||||||
|
|
||||||
|
fn main() -> Result<()> {
|
||||||
|
let mut cache = TaskCache::new(vec![TaskStatus::Deleted]);
|
||||||
|
cache.load()?;
|
||||||
|
update_tasks(&mut cache)?;
|
||||||
|
cache.write()?;
|
||||||
|
Ok(())
|
||||||
|
}
|
|
@ -153,8 +153,8 @@ impl GeneratedTask for Task {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_ignores(cache: &TaskCache) -> Result<()> {
|
fn check_ignores(cache: &TaskCache) -> Result<()> {
|
||||||
if cache.ignore().len() > 0 {
|
if *cache.ignore() != vec![TS::Deleted] {
|
||||||
return Err("Don't use generate with a TaskCache with ignores".into());
|
return Err("Don't use generate with a TaskCache with ignores other than 'TaskStatus::Deleted'".into());
|
||||||
};
|
};
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ use uuid::Uuid;
|
||||||
use task_hookrs::cache::TaskCache;
|
use task_hookrs::cache::TaskCache;
|
||||||
use task_hookrs::task::{Task, TaskBuilder};
|
use task_hookrs::task::{Task, TaskBuilder};
|
||||||
use task_hookrs::priority::TaskPriority;
|
use task_hookrs::priority::TaskPriority;
|
||||||
|
use task_hookrs::status::TaskStatus;
|
||||||
|
|
||||||
use dialog::rofi::RofiDialogProvider;
|
use dialog::rofi::RofiDialogProvider;
|
||||||
use dialog::DialogProvider;
|
use dialog::DialogProvider;
|
||||||
|
@ -183,7 +184,7 @@ impl Kassandra {
|
||||||
Ok(Kassandra {
|
Ok(Kassandra {
|
||||||
state: get_state()?,
|
state: get_state()?,
|
||||||
dialog: RofiDialogProvider {},
|
dialog: RofiDialogProvider {},
|
||||||
cache: TaskCache::new(vec![]),
|
cache: TaskCache::new(vec![TaskStatus::Deleted]),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue