diff options
author | Nora <nora.widdecke@tu-bs.de> | 2019-03-11 11:22:48 +0100 |
---|---|---|
committer | Nora <nora.widdecke@tu-bs.de> | 2019-03-11 11:22:48 +0100 |
commit | 841a25660ea1f507dc0c02c74f172ef515bdd259 (patch) | |
tree | 914b64830d339ff208db1cc650749dcaedbe12bc /src | |
parent | 1ffc0d1d39a6d5db5969c1af667bc412b195a97b (diff) |
move prettyprint to archive
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/mod.rs | 1 | ||||
-rw-r--r-- | src/actions/prettyprint.rs | 37 |
2 files changed, 0 insertions, 38 deletions
diff --git a/src/actions/mod.rs b/src/actions/mod.rs index ad58bb6..8b48fa2 100644 --- a/src/actions/mod.rs +++ b/src/actions/mod.rs @@ -8,7 +8,6 @@ pub mod list; pub mod modify; pub mod delete; pub mod new; -pub mod prettyprint; pub mod select; pub mod seq; pub mod show; diff --git a/src/actions/prettyprint.rs b/src/actions/prettyprint.rs deleted file mode 100644 index 6b7fdad..0000000 --- a/src/actions/prettyprint.rs +++ /dev/null @@ -1,37 +0,0 @@ -use crate::icalwrap::{IcalComponent,IcalProperty}; -use std::path::Path; -use crate::input; -use crate::KhResult; - -pub fn prettyprint() -> KhResult<()> { - let lines = input::default_input_khlines()?; - for line in lines { - let event = line.to_event()?.event; - prettyprint_comp(&event, line.get_path()); - } - Ok(()) -} - -pub fn prettyprint_comp(cal: &IcalComponent, path: &Path) { - let properties = cal.get_properties_all(); - debug!("path: {:?}", path); - debug!("property count: {}", properties.len()); - for property in properties { - prettyprint_prop(&property); - } - println!(); -} - -fn prettyprint_prop(property: &IcalProperty) { - let name = property.get_name(); - let value = property.get_value(); - match name.as_str() { - "DTSTART" => { - let date = property.get_value_as_date(); - println!("start: {}", date.unwrap()); - }, - "DESCRIPTION" => println!("description: {}", value), - _ => println!("{} - {}", name, value), - } -} - |