Commit f42279b
committed
Add progress bars to several commands and plugins.
Many long-running commands produce little or no feedback in the terminal to
indicate that they're progressing, and none of them provide estimates of how
long the operation will run. This change introduces the `enlighten` python
package, which displays progress bars akin to TQDM below the existing terminal
output.
To support consistent use and presentation of the progress bars, and to
allow for future modification, we introduce two methods to beets.ui -
beets.ui.iprogress_bar, and beets.ui.changed_unchanged_error_pbars -
which can be used by Beets' core commands and all Beets plugins. Example
usage is provided in the methods' documentation.
Integrating progress bars into the 'import' command required a more
custom implementation than the beets.ui.* commands could support. The
approach taken is certainly open to discussion.
Notably, the Enlighten library does not work as well in Windows
PowerShell as it does in a linux terminal (manually tested in Zsh), so
the progress bars are disabled in Windows environments. Resolving these
issues and enabling them in Windows is left as future work.1 parent ea1f5da commit f42279b
File tree
25 files changed
+1005
-243
lines changed- beetsplug
- lastgenre
- beets
- importer
- test
- ui
- docs
- guides
- test
25 files changed
+1005
-243
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
| |||
355 | 357 | | |
356 | 358 | | |
357 | 359 | | |
| 360 | + | |
358 | 361 | | |
359 | 362 | | |
360 | | - | |
| 363 | + | |
361 | 364 | | |
362 | 365 | | |
363 | 366 | | |
| |||
366 | 369 | | |
367 | 370 | | |
368 | 371 | | |
| 372 | + | |
369 | 373 | | |
370 | 374 | | |
371 | 375 | | |
| |||
638 | 642 | | |
639 | 643 | | |
640 | 644 | | |
| 645 | + | |
641 | 646 | | |
642 | 647 | | |
643 | 648 | | |
| |||
693 | 698 | | |
694 | 699 | | |
695 | 700 | | |
696 | | - | |
| 701 | + | |
697 | 702 | | |
698 | 703 | | |
699 | 704 | | |
| 705 | + | |
700 | 706 | | |
701 | 707 | | |
702 | 708 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
666 | 671 | | |
667 | 672 | | |
668 | 673 | | |
669 | 674 | | |
670 | 675 | | |
671 | 676 | | |
672 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
673 | 690 | | |
674 | 691 | | |
675 | 692 | | |
| |||
710 | 727 | | |
711 | 728 | | |
712 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
713 | 735 | | |
714 | 736 | | |
715 | 737 | | |
716 | 738 | | |
717 | 739 | | |
718 | 740 | | |
719 | 741 | | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
720 | 754 | | |
721 | 755 | | |
722 | 756 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
46 | | - | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
1370 | 1374 | | |
1371 | 1375 | | |
1372 | 1376 | | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
1373 | 1468 | | |
1374 | 1469 | | |
1375 | 1470 | | |
| |||
0 commit comments