From 3868af2f1a7163fc59fae74f6c3346f3bb7282a7 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Sun, 24 Feb 2008 22:42:02 +0000 Subject: [PATCH] tweak logic to output patches as soon as we encounter a non-patch line --- tools/cleanroom/create_new.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/cleanroom/create_new.py b/tools/cleanroom/create_new.py index ca6cff52..5cd94b6e 100644 --- a/tools/cleanroom/create_new.py +++ b/tools/cleanroom/create_new.py @@ -28,12 +28,14 @@ for line in texture1.split("\n"): oldtex = file("../../textures/combined.txt", "r").read() patches = [] for line in oldtex.split("\n"): - if len(line) == 0 or line[0] == ";" or line[0] == "#": - print line - elif line[0] == "*": + # start of a patch line + if len(line) > 0 and line[0] == "*": patches.append(line) else: if 1 == len(patches): print patches[0] patches = [] + # start of a texture definition + if re.match(r'^[A-Z]', line): + texline = line print line