~terceiro/lava-dispatcher/filter-ansi-color-codes

« back to all changes in this revision

Viewing changes to lava_dispatcher/utils.py

  • Committer: Antonio Terceiro
  • Date: 2013-08-02 16:58:43 UTC
  • Revision ID: antonio.terceiro@linaro.org-20130802165843-1l66e1vii35pef70
Need to filter out non-color codes as well, such as cursor positioning, screen
clearing etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
 
217
217
    def read_nonblocking(self, size, timeout):
218
218
        raw = super(logging_spawn, self).read_nonblocking(size, timeout)
219
 
        filtered = re.sub('\x1b\[[0-9;]*m', '', raw)
 
219
        filtered = re.sub('\x1b\[[0-9;]*\w', '', raw)
220
220
        return filtered
221
221
 
222
222