#At file:///home/mysql_src/bzrrepos_new/mysql-next-mr-opt-backporting-wl4800/ based on revid:guilhem@stripped
3211 Guilhem Bichot 2010-09-24
fix script now that the trace may not start with \n
modified:
WL4800_validate_json.py
=== modified file 'WL4800_validate_json.py'
--- a/WL4800_validate_json.py 2010-09-20 08:12:18 +0000
+++ b/WL4800_validate_json.py 2010-09-24 07:00:36 +0000
@@ -45,16 +45,20 @@ def check(trace, first_trace_line):
print
all = open(sys.argv[1]).readlines()
+trace_start_re = re.compile("^(.*\t)?{\n")
+trace_end_re = re.compile("^}(\t.*)?\n")
first_trace_line = trace_line = 0
trace = None
for l in all:
trace_line += 1
- if l == "{\n":
+ if trace_start_re.match(l):
assert first_trace_line == 0
trace = []
first_trace_line = trace_line
- if l.startswith("}\t") or l.startswith("}\n"): # end of current trace
+ trace.append("{\n")
+ continue
+ if trace_end_re.match(l):
assert first_trace_line != 0
trace.append("}") # eliminate any following columns of table (OS_MALLOC_ERROR etc)
check(trace, first_trace_line)
Attachment: [text/bzr-bundle] bzr/guilhem@mysql.com-20100924070036-ti4jk7ri0alv07xc.bundle
| Thread |
|---|
| • bzr commit into mysql-next-mr-bugfixing branch (guilhem:3211) | Guilhem Bichot | 24 Sep |