def console_thread(self):
        while True:
            try:
                tag, text = self.q.get()
                if not self.quietmode:
                    # Tag is tuple of (label, stderr_flag)
                    for line in self.formatter(tag, text):
                        sys.stdout.write(line)
                        if self.retain_recent:
                            self.recent_history[str(tag[0])].append(line)
                    sys.stdout.flush()
            except Exception as e:
                sys.stdout.write('Console Thread Exception: %s\n' % str(e))
                sys.stdout.write('(%s): %s\n' % (tag, text))
            finally:
                self.q.task_done()
Clears the cache (if primed) each time a site is saved or deleted
dataset/ETHPy150Open radssh/radssh/radssh/console.py/RadSSHConsole.console_thread--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/contrib/sites/models.py/clear_site_cache