MCPcopy Index your code
hub / github.com/nodejs/node / UiCounter

Class UiCounter

deps/v8/tools/stats-viewer.py:271–300  ·  view source on GitHub ↗

A counter in the ui.

Source from the content-addressed store, hash-verified

269
270
271class UiCounter(object):
272 """A counter in the ui."""
273
274 def __init__(self, var, format):
275 """Creates a new ui counter.
276
277 Args:
278 var: the Tkinter string variable for updating the ui
279 format: the format string used to format this counter
280 """
281 self.var = var
282 self.format = format
283 self.last_value = None
284
285 def Set(self, value):
286 """Updates the ui for this counter.
287
288 Args:
289 value: The value to display
290
291 Returns:
292 True if the value had changed, otherwise False. The first call
293 always returns True.
294 """
295 if value == self.last_value:
296 return False
297 else:
298 self.last_value = value
299 self.var.set(self.format % value)
300 return True
301
302
303class SharedDataAccess(object):

Callers 1

RebuildMainWindowMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…