(self)
Read the contents of the memory-mapped file and update the ui if
    necessary.  If the same counters are present in the file as before
    we just update the existing labels.  If any counters have been added
    or removed we scrap the existing ui and draw a new one.
Read the contents of the memory-mapped file and update the ui if
    necessary.  If the same counters are present in the file as before
    we just update the existing labels.  If any counters have been added
    or removed we scrap the existing ui and draw a new one.
Read the contents of the memory - mapped file and update the ui if necessary . If the same counters are present in the file as before we just update the existing labels . If any counters have been added or removed we scrap the existing ui and draw a new one .
def UpdateCounters(self):
    """Read the contents of the memory-mapped file and update the ui if
    necessary.  If the same counters are present in the file as before
    we just update the existing labels.  If any counters have been added
    or removed we scrap the existing ui and draw a new one.
    """
    changed = False
    counters_in_use = self.data.CountersInUse()
    if counters_in_use != len(self.ui_counters):
      self.RefreshCounters()
      changed = True
    else:
      for i in range(self.data.CountersInUse()):
        counter = self.data.Counter(i)
        name = counter.Name()
        if name in self.ui_counters:
          value = counter.Value()
          ui_counter = self.ui_counters[name]
          counter_changed = ui_counter.Set(value)
          changed = (changed or counter_changed)
        else:
          self.RefreshCounters()
          changed = True
          break
    if changed:
      # The title of the window shows the last time the file was
      # changed.
      self.UpdateTime()
    self.ScheduleUpdate()
def UpdateCounters ( self ) : changed = False counters_in_use = self . data . CountersInUse ( ) if counters_in_use != len ( self . ui_counters ) : self . RefreshCounters ( ) changed = True else : for i in range ( self . data . CountersInUse ( ) ) : counter = self . data . Counter ( i ) name = counter . Name ( ) if name in self . ui_counters : value = counter . Value ( ) ui_counter = self . ui_counters [ name ] counter_changed = ui_counter . Set ( value ) changed = ( changed or counter_changed ) else : self . RefreshCounters ( ) changed = True break if changed : # The title of the window shows the last time the file was # changed. self . UpdateTime ( ) self . ScheduleUpdate ( )