MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / TqdmHBox

Class TqdmHBox

pager_lib/tqdm/notebook.py:69–87  ·  view source on GitHub ↗

`ipywidgets.HBox` with a pretty representation

Source from the content-addressed store, hash-verified

67
68
69class TqdmHBox(HBox):
70 """`ipywidgets.HBox` with a pretty representation"""
71 def _json_(self, pretty=None):
72 pbar = getattr(self, 'pbar', None)
73 if pbar is None:
74 return {}
75 d = pbar.format_dict
76 if pretty is not None:
77 d["ascii"] = not pretty
78 return d
79
80 def __repr__(self, pretty=False):
81 pbar = getattr(self, 'pbar', None)
82 if pbar is None:
83 return super().__repr__()
84 return pbar.format_meter(**self._json_(pretty))
85
86 def _repr_pretty_(self, pp, *_, **__):
87 pp.text(self.__repr__(True))
88
89
90class tqdm_notebook(std_tqdm):

Callers 1

status_printerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected