From b57d80da7765b2f06ba37758c05819456c27d0b9 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 13:47:42 +0000 Subject: util: Allow '#' comments in u_format.csv. --- src/gallium/auxiliary/util/u_format_parse.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index 5d49fc7652..37336029d8 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -137,7 +137,15 @@ def parse(filename): stream = open(filename) formats = [] for line in stream: - line = line.rstrip() + try: + comment = line.index('#') + except ValueError: + pass + else: + line = line[:comment] + line = line.strip() + if not line: + continue fields = [field.strip() for field in line.split(',')] name = fields[0] layout = fields[1] -- cgit v1.2.3