~nicohman/raven

783b2b24de49b61df10b33f790d1238e2fec075e — Nico Hickman 2 years ago afe4d89
Update to ravenlib v1.2.2
3 files changed, 48 insertions(+), 32 deletions(-)

M Cargo.lock
M Cargo.toml
M src/main.rs
M Cargo.lock => Cargo.lock +13 -5
@@ 321,6 321,14 @@ dependencies = [
]

[[package]]
name = "error-chain"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "failure"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 919,10 927,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "ravenlib"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
version = "1.2.1"
dependencies = [
 "dirs 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
 "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "multipart 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "reqwest 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",


@@ 933,10 941,10 @@ dependencies = [

[[package]]
name = "raventhemer"
version = "1.5.0"
version = "1.5.1"
dependencies = [
 "dirs 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
 "ravenlib 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "ravenlib 1.2.1",
 "structopt 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
 "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
]


@@ 1625,6 1633,7 @@ dependencies = [
"checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18"
"checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569"
"checksum encoding_rs 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "21a550ec129ca2f8593227888625c7c5331c6ad878e2cee6b7ac25e1c7d05746"
"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02"
"checksum failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6dd377bcc1b1b7ce911967e3ec24fa19c3224394ec05b54aa7b083d498341ac7"
"checksum failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "64c2d913fe8ed3b6c6518eedf4538255b989945c14c2a7d5cbff62a5e2120596"
"checksum filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "da4b9849e77b13195302c174324b5ba73eec9b236b24c221a61000daefb95c5f"


@@ 1691,7 1700,6 @@ dependencies = [
"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5"
"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2"
"checksum ravenlib 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6fb349e2cd05a093b354ecfaf6cdfe60cb65f7b5e3da577ae9435068349d1a4"
"checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
"checksum redox_users 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "214a97e49be64fd2c86f568dd0cb2c757d2cc53de95b273b6ad0a1c908482f26"

M Cargo.toml => Cargo.toml +1 -1
@@ 15,7 15,7 @@ path = "src/main.rs"
name = "ravend"
path = "src/ravend.rs"
[dependencies]
ravenlib = "1.0.0"
ravenlib = "1.2.2"
time = "0.1"
structopt = "0.2.10"
dirs = "1.0"

M src/main.rs => src/main.rs +34 -26
@@ 10,7 10,7 @@ use dirs::home_dir;
use ravenlib::{config::*, daemon::*, ravenserver::*, themes::*};
fn main() {
    if check_init() {
        init();
        init().unwrap();
    }
    interpet_args();
}


@@ 20,36 20,42 @@ fn interpet_args() {
    use Cycle::*;
    use Manage::*;
    use Raven::*;
    check_themes();
    check_themes().unwrap();
    //If a theme may be changing, kill the previous theme's processes. Currently only polybar
    //and lemonbar
    let conf = get_config();
    let conf = get_config().unwrap();
    match r {
        Load { theme } => {
            run_theme(&load_theme(theme).unwrap());
            run_theme(&load_theme(theme).unwrap()).unwrap();
        }
        New { name } => new_theme(name),
        New { name } => new_theme(name).unwrap(),
        Modify { name, editor } => modify_file(conf.editing, name, editor),
        Delete { name } => del_theme(name),
        Edit { name } => edit(name),
        Key {key, value} => key_value(key, value, conf.editing),
        Delete { name } => del_theme(name).unwrap(),
        Edit { name } => {
            edit(name).unwrap();
        },
        Key {key, value} => key_value(key, value, conf.editing).unwrap(),
        ManageO { .. } => {
            match r {
                ManageO(Export { name }) => {
                    export(name, check_tmp());
                    export(name, check_tmp()).unwrap();
                }
                ManageO(Import { name }) => import(name),
                ManageO(Publish { name }) => upload_theme(name),
                ManageO(Create { name, pass1, pass2 }) => create_user(name, pass1, pass2),
                ManageO(Unpublish { name }) => unpublish_theme(name),
                ManageO(Login { name, pass }) => login_user(name, pass),
                ManageO(Logout {}) => logout(),
                ManageO(DUser { pass }) => delete_user(pass),
                ManageO(Import { name }) => import(name).unwrap(),
                ManageO(Publish { name }) => {
                    upload_theme(name).unwrap();
                },
                ManageO(Create { name, pass1, pass2 }) => {
                    create_user(name, pass1, pass2).unwrap();
                },
                ManageO(Unpublish { name }) => unpublish_theme(name).unwrap(),
                ManageO(Login { name, pass }) => login_user(name, pass).unwrap(),
                ManageO(Logout {}) => logout().unwrap(),
                ManageO(DUser { pass }) => delete_user(pass).unwrap(),
                _ => println!("Well, this shouldn't be happening"),
            };
        }
        CycleD { .. } => {
            let running = check_daemon();
            let running = check_daemon().unwrap();
            match r {
                CycleD(Check {}) => {
                    if running {


@@ 60,14 66,14 @@ fn interpet_args() {
                }
                CycleD(Start {}) => {
                    if !running {
                        start_daemon();
                        start_daemon().unwrap();
                    } else {
                        println!("Cycle daemon already running.");
                    }
                }
                CycleD(Stop {}) => {
                    if running {
                        stop_daemon();
                        stop_daemon().unwrap();
                    } else {
                        println!("Cycle daemon not running.");
                    }


@@ 79,11 85,13 @@ fn interpet_args() {
        }
        Info {} => print_info(conf.editing),
        Refresh {} => {
            refresh_theme(conf.last);
            refresh_theme(conf.last).unwrap();
        }
        Install { name, force } => download_theme(name, force),
        Add { name, option } => add_to_theme(conf.editing, option, name),
        Rm { name } => rm_from_theme(conf.editing, name),
        Install { name, force } => {
            download_theme(name, force).unwrap();
        },
        Add { name, option } => add_to_theme(conf.editing, option, name).unwrap(),
        Rm { name } => rm_from_theme(conf.editing, name).unwrap(),
        Menu {} => show_menu(conf.menu_command),
    };
}


@@ 105,7 113,7 @@ where
        println!("{}", option);
    }
    println!("All themes: ");
    let themes = get_themes();
    let themes = get_themes().unwrap();
    for t in themes {
        println!("{}", t);
    }


@@ 135,7 143,7 @@ where
    N: Into<String>,
{
    let mut theme_list = String::new();
    let mut entries = get_themes();
    let mut entries = get_themes().unwrap();
    entries.sort_by(|a, b| a.cmp(&b));
    let mut i = 0;
    for entry in entries {


@@ 158,7 166,7 @@ where
        if theme.is_err() {
            println!("Could not load in theme data. Does it exist?");
        } else {
            run_theme(&theme.unwrap());
            run_theme(&theme.unwrap()).unwrap();
        }
    } else {
        println!("Theme not selected.");