summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-11-07 16:04:45 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-11-07 17:34:00 +0100
commite4512d60e989f7d31febabb3934fd028af48522b (patch)
tree977a91820c85b09cf058711e14d8aec900ac539a /src/util
parenta3c4b3900b6aff923e9c1f0fafbf6cb1069def83 (diff)
Degrade ProgressBars to a simple progress-bar-generation helper
This patch removes the idea of having a "MultiProgress" object from indicativ available in the top level of butido. It turned out that the progress bars were not updated until the MultiProgress::join() method was called, which basically yields the progress bars useless. Thus, we remove the multi-progress-bar idea from top level. Later, we might implement a multi-progress bar viewing in the orchestrator, so we can see which job is progressed how far. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/progress.rs26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/util/progress.rs b/src/util/progress.rs
index 70742ae..ca4c96b 100644
--- a/src/util/progress.rs
+++ b/src/util/progress.rs
@@ -1,40 +1,34 @@
use indicatif::*;
pub struct ProgressBars {
- multi: MultiProgress,
bar_template: String,
}
impl ProgressBars {
pub fn setup(bar_template: String) -> Self {
ProgressBars {
- multi: MultiProgress::new(),
bar_template,
}
}
- pub fn into_inner(self) -> MultiProgress {
- self.multi
+ pub fn tree_building(&self) -> ProgressBar {
+ Self::bar("Building package tree", &self.bar_template)
}
- pub fn tree_building(&mut self) -> ProgressBar {
- self.multi.add(Self::bar("Building package tree", &self.bar_template))
+ pub fn repo_loading(&self) -> ProgressBar {
+ Self::bar("Repository loading", &self.bar_template)
}
- pub fn repo_loading(&mut self) -> ProgressBar {
- self.multi.add(Self::bar("Repository loading", &self.bar_template))
+ pub fn staging_loading(&self) -> ProgressBar {
+ Self::bar("Loading staging", &self.bar_template)
}
- pub fn staging_loading(&mut self) -> ProgressBar {
- self.multi.add(Self::bar("Loading staging", &self.bar_template))
+ pub fn release_loading(&self) -> ProgressBar {
+ Self::bar("Loading releases", &self.bar_template)
}
- pub fn release_loading(&mut self) -> ProgressBar {
- self.multi.add(Self::bar("Loading releases", &self.bar_template))
- }
-
- pub fn what_depends(&mut self) -> ProgressBar {
- self.multi.add(Self::bar("Crawling dependencies", &self.bar_template))
+ pub fn what_depends(&self) -> ProgressBar {
+ Self::bar("Crawling dependencies", &self.bar_template)
}
fn bar(msg: &str, template: &str) -> ProgressBar {