'Output and count a warning.  Suppress duplicate warnings.'

def Warn(self, text):

    if text:
        text = encoder.NarrowText(text, None)
        hash = hashlib.md5(text).hexdigest()
        if (not self._warns_shown.has_key(hash)):
            self._warns_shown[hash] = 1
            print ('[WARNING]    ' + text)
        else:
            self.Log(('(suppressed)    [WARNING]    ' + text), 3)
        self.num_warns = (self.num_warns + 1)
