Add a fix-eml.py script
For trying to fix up patches mangled by Outlook Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
864963a903
commit
3a2a30af33
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/python
|
||||
import re
|
||||
import sys
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
print(f"Usage: {sys.argv[0]} FILE")
|
||||
sys.exit(1)
|
||||
|
||||
with open(sys.argv[1]) as f:
|
||||
line = ""
|
||||
for l in f:
|
||||
if len(l) == 77 and l[-2] == "=":
|
||||
line += l[:-2]
|
||||
else:
|
||||
line += l
|
||||
if not re.match("NetApp Security WARNING:", line):
|
||||
line = re.sub("^\+ ", "+ ", line, count=1)
|
||||
line = re.sub("^\- ", "- ", line, count=1)
|
||||
line = re.sub("^ ", " ", line, count=1)
|
||||
line = re.sub(" ", " ", line)
|
||||
line = re.sub("=3D", "=", line)
|
||||
print(line, end="")
|
||||
line = ""
|
Loading…
Reference in New Issue