From 5e1774642796ae04dc048e92b13bfe7a96ed1598 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Thu, 2 Jun 2016 11:43:34 -0500 Subject: [PATCH] Post process script for fan kickstart Addresses #3308 --- utils/post-processing/fan_kickstart.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 utils/post-processing/fan_kickstart.py diff --git a/utils/post-processing/fan_kickstart.py b/utils/post-processing/fan_kickstart.py new file mode 100644 index 000000000..9ee1bc0a4 --- /dev/null +++ b/utils/post-processing/fan_kickstart.py @@ -0,0 +1,13 @@ +#!/usr/bin/python +import sys +import re + +sea = re.compile("M106 S[1-9]+[0-9]*") +rep = re.compile("M106 S255\n\g<0>") +out = open(sys.argv[1]+"_fixed", 'w') + with open(sys.argv[1]) as f: + for r in f: + if re.search(sea, r) is not None: + out.write(re.sub(sea,"M106 S255\n\g<0>",r)) + else: + out.write(r)