pyrls 0.1.0

A single-binary release automation tool for Python projects
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::borrow::Cow;

use indicatif::{ProgressBar, ProgressStyle};

pub fn spinner(message: impl Into<Cow<'static, str>>) -> ProgressBar {
    let pb = ProgressBar::new_spinner();
    pb.set_style(
        ProgressStyle::default_spinner()
            .tick_chars("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏ ")
            .template("{spinner:.cyan} {msg}")
            .expect("valid template"),
    );
    pb.enable_steady_tick(std::time::Duration::from_millis(80));
    pb.set_message(message);
    pb
}