File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,14 @@ class Tqdm(tqdm):
2020 """
2121
2222 BAR_FMT_DEFAULT = (
23- "{percentage:3.0f}%|{bar:10}|"
24- "{desc:{ncols_desc}.{ncols_desc}}{n_fmt}/{total_fmt}"
23+ "{percentage:3.0f}% {desc}|{bar}|"
24+ "{n_fmt}/{total_fmt}"
25+ " [{elapsed}<{remaining}, {rate_fmt:>11}{postfix}]"
26+ )
27+ # nested bars should have fixed bar widths to align nicely
28+ BAR_FMT_DEFAULT_NESTED = (
29+ "{percentage:3.0f}%|{bar:10}|{desc:{ncols_desc}.{ncols_desc}}"
30+ "{n_fmt}/{total_fmt}"
2531 " [{elapsed}<{remaining}, {rate_fmt:>11}{postfix}]"
2632 )
2733 BAR_FMT_NOTOTAL = (
@@ -83,7 +89,11 @@ def __init__(
8389 )
8490 if bar_format is None :
8591 if self .__len__ ():
86- self .bar_format = self .BAR_FMT_DEFAULT
92+ self .bar_format = (
93+ self .BAR_FMT_DEFAULT_NESTED
94+ if self .pos
95+ else self .BAR_FMT_DEFAULT
96+ )
8797 else :
8898 self .bar_format = self .BAR_FMT_NOTOTAL
8999 else :
You can’t perform that action at this time.
0 commit comments