On Sun, 2 Jun 2013 15:05:21 -0400
Jeffrey Blank <blank(a)eclipse.ncsc.mil> wrote:
Signed-off-by: Jeffrey Blank <blank(a)eclipse.ncsc.mil>
---
RHEL6/transforms/combinefixes.py | 97
+++++++++++++++++--------------------- 1 files changed, 44 insertions(+), 53
deletions(-)
diff --git a/RHEL6/transforms/combinefixes.py
b/RHEL6/transforms/combinefixes.py index f9d8b7f..71fbe6f 100755
--- a/RHEL6/transforms/combinefixes.py
+++ b/RHEL6/transforms/combinefixes.py
@@ -1,58 +1,49 @@
#!/usr/bin/python
-import sys, os
-
-header = '''<fix-content system="urn:xccdf:fix:script:sh"
xmlns="http://checklists.nist.gov/xccdf/1.1">\n''' -footer =
'</fix-content>\n' -fixGroupHeader = '''<fix-group
id="bash"
system="urn:xccdf:fix:script:sh"
xmlns="http://checklists.nist.gov/xccdf/1.1">\n'''
-fixGroupFooter =
'</fix-group>\n' -fixCommonGroupHeader =
'''<fix-common-group
id="bash-common"
xmlns="http://checklists.nist.gov/xccdf/1.1">\n'''
-fixCommonGroupFooter = '</fix-common-group>\n' - -def encode(text):
- text = text.replace('&','&')
- text = text.replace('>','>')
- text = text.replace('<','<')
- return text
+import sys, os, re, lxml.etree as etree
Jeff, this is great! The lxml.etree is pretty cool. How do you know or how
to find out about these gems? I'm really familiar with "cpan" for perl, is
there something similar for python?
--
Brian Millett
"Do you not have files on the Vorlons?"
'Absolutely. Very large files. But nothing is in them, of course.'
-- [ Delenn and Sinclair, "The Gathering"]