🎨 Palette: Add progress bar for cache warming#88
🎨 Palette: Add progress bar for cache warming#88google-labs-jules[bot] wants to merge 1 commit intomainfrom
Conversation
Added a `ProgressBar` class to providing visual feedback during the URL pre-fetching phase. This improves UX by replacing a static wait with an active indicator. - Implemented `ProgressBar` class with TTY support. - Updated `warm_up_cache` to use the progress bar. - Added `clear` method to handle log interleaving cleanly.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
| self.length = length | ||
| self.current = 0 | ||
|
|
||
| def increment(self): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing method docstring Warning
| self.current += 1 | ||
| self._print() | ||
|
|
||
| def clear(self): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing method docstring Warning
| self.current += 1 | ||
| self._print() | ||
|
|
||
| def clear(self): |
Check warning
Code scanning / Pylint (reported by Codacy)
Method could be a function Warning
|
|
||
| percent = float(self.current) / self.total | ||
| filled = int(self.length * percent) | ||
| bar = '█' * filled + '-' * (self.length - filled) |
Check warning
Code scanning / Pylint (reported by Codacy)
Black listed name "bar" Warning
| filled = int(self.length * percent) | ||
| bar = '█' * filled + '-' * (self.length - filled) | ||
|
|
||
| sys.stderr.write(f"\r{Colors.CYAN}{self.prefix} |{bar}| {self.current}/{self.total}{Colors.ENDC}") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (106/100) Warning
| self.length = length | ||
| self.current = 0 | ||
|
|
||
| def increment(self): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring Warning
| self.current += 1 | ||
| self._print() | ||
|
|
||
| def clear(self): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring Warning
| self.current += 1 | ||
| self._print() | ||
|
|
||
| def clear(self): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Method could be a function Warning
|
|
||
| percent = float(self.current) / self.total | ||
| filled = int(self.length * percent) | ||
| bar = '█' * filled + '-' * (self.length - filled) |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Black listed name "bar" Warning
| filled = int(self.length * percent) | ||
| bar = '█' * filled + '-' * (self.length - filled) | ||
|
|
||
| sys.stderr.write(f"\r{Colors.CYAN}{self.prefix} |{bar}| {self.current}/{self.total}{Colors.ENDC}") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (106/100) Warning
|
Superseded: Progress bar for cache warming already in main. |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
Added a progress bar to the
warm_up_cachefunction to provide visual feedback during the URL fetching process. This addresses the lack of feedback during the initial "Warming up cache" phase.Changes
ProgressBarclass inmain.py.ProgressBarintowarm_up_cacheloop.Verification
python3 main.py --dry-runto verify the progress bar appears and functions correctly during cache warming.PR created automatically by Jules for task 1257517881805291531 started by @abhimehro