Renamed the crate as kitchen_fridge

This commit is contained in:
daladim 2021-04-28 23:46:11 +02:00
parent 9b622e1ad6
commit f1a350f6a5
6 changed files with 72 additions and 72 deletions

42
Cargo.lock generated
View file

@ -374,6 +374,27 @@ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]]
name = "kitchen-fridge"
version = "0.1.0"
dependencies = [
"async-trait",
"bitflags",
"chrono",
"env_logger",
"ical",
"ics",
"log",
"minidom",
"reqwest",
"sanitize-filename",
"serde",
"serde_json",
"tokio",
"url",
"uuid",
]
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.4.0" version = "1.4.0"
@ -445,27 +466,6 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "my-tasks"
version = "0.1.0"
dependencies = [
"async-trait",
"bitflags",
"chrono",
"env_logger",
"ical",
"ics",
"log",
"minidom",
"reqwest",
"sanitize-filename",
"serde",
"serde_json",
"tokio",
"url",
"uuid",
]
[[package]] [[package]]
name = "native-tls" name = "native-tls"
version = "0.2.7" version = "0.2.7"

View file

@ -1,7 +1,7 @@
[package] [package]
name = "my-tasks" name = "kitchen-fridge"
version = "0.1.0" version = "0.1.0"
authors = ["Jérôme"] authors = ["daladim"]
edition = "2018" edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -2,24 +2,24 @@ use std::path::Path;
use chrono::{Utc}; use chrono::{Utc};
use my_tasks::{client::Client, traits::CalDavSource}; use kitchen_fridge::{client::Client, traits::CalDavSource};
use my_tasks::calendar::{CalendarId, SupportedComponents}; use kitchen_fridge::calendar::{CalendarId, SupportedComponents};
use my_tasks::calendar::cached_calendar::CachedCalendar; use kitchen_fridge::calendar::cached_calendar::CachedCalendar;
use my_tasks::calendar::remote_calendar::RemoteCalendar; use kitchen_fridge::calendar::remote_calendar::RemoteCalendar;
use my_tasks::Item; use kitchen_fridge::Item;
use my_tasks::Task; use kitchen_fridge::Task;
use my_tasks::task::CompletionStatus; use kitchen_fridge::task::CompletionStatus;
use my_tasks::ItemId; use kitchen_fridge::ItemId;
use my_tasks::cache::Cache; use kitchen_fridge::cache::Cache;
use my_tasks::Provider; use kitchen_fridge::CalDavProvider;
use my_tasks::traits::BaseCalendar; use kitchen_fridge::traits::BaseCalendar;
use my_tasks::traits::CompleteCalendar; use kitchen_fridge::traits::CompleteCalendar;
use my_tasks::settings::URL; use kitchen_fridge::settings::URL;
use my_tasks::settings::USERNAME; use kitchen_fridge::settings::USERNAME;
use my_tasks::settings::PASSWORD; use kitchen_fridge::settings::PASSWORD;
use my_tasks::settings::EXAMPLE_CREATED_CALENDAR_URL; use kitchen_fridge::settings::EXAMPLE_CREATED_CALENDAR_URL;
use my_tasks::settings::EXAMPLE_EXISTING_CALENDAR_URL; use kitchen_fridge::settings::EXAMPLE_EXISTING_CALENDAR_URL;
use my_tasks::utils::pause; use kitchen_fridge::utils::pause;
const CACHE_FOLDER: &str = "test_cache/provider_sync"; const CACHE_FOLDER: &str = "test_cache/provider_sync";
@ -47,7 +47,7 @@ async fn main() {
let cals = provider.local().get_calendars().await.unwrap(); let cals = provider.local().get_calendars().await.unwrap();
println!("---- Local items, before sync -----"); println!("---- Local items, before sync -----");
my_tasks::utils::print_calendar_list(&cals).await; kitchen_fridge::utils::print_calendar_list(&cals).await;
println!("Starting a sync..."); println!("Starting a sync...");
if provider.sync().await == false { if provider.sync().await == false {
@ -57,7 +57,7 @@ async fn main() {
println!("---- Local items, after sync -----"); println!("---- Local items, after sync -----");
let cals = provider.local().get_calendars().await.unwrap(); let cals = provider.local().get_calendars().await.unwrap();
my_tasks::utils::print_calendar_list(&cals).await; kitchen_fridge::utils::print_calendar_list(&cals).await;
add_items_and_sync_again(&mut provider).await; add_items_and_sync_again(&mut provider).await;
} }

View file

@ -6,14 +6,14 @@ use reqwest::header::CONTENT_TYPE;
use minidom::Element; use minidom::Element;
use url::Url; use url::Url;
use my_tasks::{calendar::SupportedComponents, client::Client}; use kitchen_fridge::{calendar::SupportedComponents, client::Client};
use my_tasks::traits::CalDavSource; use kitchen_fridge::traits::CalDavSource;
use my_tasks::settings::URL; use kitchen_fridge::settings::URL;
use my_tasks::settings::USERNAME; use kitchen_fridge::settings::USERNAME;
use my_tasks::settings::PASSWORD; use kitchen_fridge::settings::PASSWORD;
use my_tasks::settings::EXAMPLE_TASK_URL; use kitchen_fridge::settings::EXAMPLE_TASK_URL;
use my_tasks::settings::EXAMPLE_CREATED_CALENDAR_URL; use kitchen_fridge::settings::EXAMPLE_CREATED_CALENDAR_URL;
static EXAMPLE_TASKS_BODY_LAST_MODIFIED: &str = r#" static EXAMPLE_TASKS_BODY_LAST_MODIFIED: &str = r#"
@ -45,7 +45,7 @@ async fn show_calendars() {
let calendars = client.get_calendars().await.unwrap(); let calendars = client.get_calendars().await.unwrap();
println!("Calendars:"); println!("Calendars:");
my_tasks::utils::print_dav_calendar_list(&calendars).await; kitchen_fridge::utils::print_dav_calendar_list(&calendars).await;
} }
@ -54,7 +54,7 @@ async fn create_cal() {
let _ = env_logger::builder().is_test(true).try_init(); let _ = env_logger::builder().is_test(true).try_init();
let mut client = Client::new(URL, USERNAME, PASSWORD).unwrap(); let mut client = Client::new(URL, USERNAME, PASSWORD).unwrap();
let id: Url = my_tasks::settings::EXAMPLE_CREATED_CALENDAR_URL.parse().unwrap(); let id: Url = kitchen_fridge::settings::EXAMPLE_CREATED_CALENDAR_URL.parse().unwrap();
let name = "prout".into(); let name = "prout".into();
let supported_components = SupportedComponents::TODO; let supported_components = SupportedComponents::TODO;
client.create_calendar(id, name, supported_components).await.unwrap(); client.create_calendar(id, name, supported_components).await.unwrap();
@ -104,7 +104,7 @@ async fn last_modified() {
.unwrap(); .unwrap();
let el: Element = res.text().await.unwrap().parse().unwrap(); let el: Element = res.text().await.unwrap().parse().unwrap();
my_tasks::utils::print_xml(&el); kitchen_fridge::utils::print_xml(&el);
} }

View file

@ -14,21 +14,21 @@ use std::error::Error;
use chrono::Utc; use chrono::Utc;
use my_tasks::calendar::CalendarId; use kitchen_fridge::calendar::CalendarId;
use my_tasks::calendar::SupportedComponents; use kitchen_fridge::calendar::SupportedComponents;
use my_tasks::traits::CalDavSource; use kitchen_fridge::traits::CalDavSource;
use my_tasks::traits::BaseCalendar; use kitchen_fridge::traits::BaseCalendar;
use my_tasks::traits::CompleteCalendar; use kitchen_fridge::traits::CompleteCalendar;
use my_tasks::traits::DavCalendar; use kitchen_fridge::traits::DavCalendar;
use my_tasks::cache::Cache; use kitchen_fridge::cache::Cache;
use my_tasks::Item; use kitchen_fridge::Item;
use my_tasks::ItemId; use kitchen_fridge::ItemId;
use my_tasks::SyncStatus; use kitchen_fridge::SyncStatus;
use my_tasks::Task; use kitchen_fridge::Task;
use my_tasks::task::CompletionStatus; use kitchen_fridge::task::CompletionStatus;
use my_tasks::calendar::cached_calendar::CachedCalendar; use kitchen_fridge::calendar::cached_calendar::CachedCalendar;
use my_tasks::Provider; use kitchen_fridge::Provider;
use my_tasks::mock_behaviour::MockBehaviour; use kitchen_fridge::mock_behaviour::MockBehaviour;
pub enum LocatedState { pub enum LocatedState {
/// Item does not exist yet or does not exist anymore /// Item does not exist yet or does not exist anymore

View file

@ -4,7 +4,7 @@ mod scenarii;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
#[cfg(feature = "local_calendar_mocks_remote_calendars")] #[cfg(feature = "local_calendar_mocks_remote_calendars")]
use my_tasks::mock_behaviour::MockBehaviour; use kitchen_fridge::mock_behaviour::MockBehaviour;
@ -339,7 +339,7 @@ async fn test_errors_in_regular_sync12() {
} }
#[cfg(feature = "integration_tests")] #[cfg(feature = "integration_tests")]
use my_tasks::{traits::CalDavSource, use kitchen_fridge::{traits::CalDavSource,
Provider, Provider,
cache::Cache, cache::Cache,
calendar::cached_calendar::CachedCalendar, calendar::cached_calendar::CachedCalendar,
@ -351,8 +351,8 @@ use my_tasks::{traits::CalDavSource,
async fn print_provider(provider: &Provider<Cache, CachedCalendar, Cache, CachedCalendar>, title: &str) { async fn print_provider(provider: &Provider<Cache, CachedCalendar, Cache, CachedCalendar>, title: &str) {
let cals_server = provider.remote().get_calendars().await.unwrap(); let cals_server = provider.remote().get_calendars().await.unwrap();
println!("----Server, {}-------", title); println!("----Server, {}-------", title);
my_tasks::utils::print_calendar_list(&cals_server).await; kitchen_fridge::utils::print_calendar_list(&cals_server).await;
let cals_local = provider.local().get_calendars().await.unwrap(); let cals_local = provider.local().get_calendars().await.unwrap();
println!("-----Local, {}-------", title); println!("-----Local, {}-------", title);
my_tasks::utils::print_calendar_list(&cals_local).await; kitchen_fridge::utils::print_calendar_list(&cals_local).await;
} }