mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
Remove color stripping script
This commit is contained in:
parent
9474886d85
commit
fb032c177f
1 changed files with 0 additions and 24 deletions
|
@ -1,24 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import re
|
||||
|
||||
def strip_color (input, output):
|
||||
|
||||
_escape = re.compile ("\x1b\\[[0-9;]*m")
|
||||
# TODO: This can be optimized further!
|
||||
|
||||
for line in input:
|
||||
while "\x1b" in line:
|
||||
line = _escape.sub ("", line)
|
||||
output.write (line)
|
||||
|
||||
def main ():
|
||||
|
||||
if len (sys.argv) == 1 or sys.argv[1] == "-":
|
||||
strip_color (sys.stdin, sys.stdout)
|
||||
else:
|
||||
strip_color (file (sys.argv[1], "rb"), sys.stdout)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main ()
|
Loading…
Reference in a new issue