minor cosmetic changes
This commit is contained in:
parent
70aeee0e00
commit
1ee2601626
@ -23,6 +23,7 @@ import os.path
|
|||||||
import re
|
import re
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
from urllib.parse import unquote
|
||||||
|
|
||||||
|
|
||||||
# Read configuration from ini file
|
# Read configuration from ini file
|
||||||
@ -49,6 +50,9 @@ def line(level,key,value):
|
|||||||
elif level == 3: lvl = " * "
|
elif level == 3: lvl = " * "
|
||||||
else: lvl = ""
|
else: lvl = ""
|
||||||
|
|
||||||
|
if value:
|
||||||
|
value = unquote(value)
|
||||||
|
|
||||||
if key:
|
if key:
|
||||||
if value == "N/A": output = lvl + key_style + key + key_style + "\n"
|
if value == "N/A": output = lvl + key_style + key + key_style + "\n"
|
||||||
elif value: output = lvl + key_style + key + key_style + " " + \
|
elif value: output = lvl + key_style + key + key_style + " " + \
|
||||||
@ -143,7 +147,7 @@ def main(xmlfile,outfile):
|
|||||||
v = ""
|
v = ""
|
||||||
t = ""
|
t = ""
|
||||||
if not r.get('name') == "Root Rule":
|
if not r.get('name') == "Root Rule":
|
||||||
file.write("\n#### " + r.get('name') + "\n")
|
file.write("\n#### " + r.get('name').title().replace("_", " ") + "\n")
|
||||||
for e in r.iter():
|
for e in r.iter():
|
||||||
if str(e.tag) == 'activate':
|
if str(e.tag) == 'activate':
|
||||||
file.write(line(1,"Activate:",e.get('type')))
|
file.write(line(1,"Activate:",e.get('type')))
|
||||||
@ -162,10 +166,8 @@ def main(xmlfile,outfile):
|
|||||||
if str(e.tag) == 'match':
|
if str(e.tag) == 'match':
|
||||||
file.write(line(1,"Match Type:",e.get('matchType')))
|
file.write(line(1,"Match Type:",e.get('matchType')))
|
||||||
file.write(line(2,"Count:",e.get('count')))
|
file.write(line(2,"Count:",e.get('count')))
|
||||||
#file.write(line(2,"Match Type:",e.get('matchType')))
|
|
||||||
if str(e.tag) == 'matchFilter':
|
if str(e.tag) == 'matchFilter':
|
||||||
file.write(line(1,"Match Filter:",e.get('type').upper()))
|
file.write(line(1,"Match Filter:",e.get('type').upper()))
|
||||||
#file.write(line(2,"Logical Element Type:",e.get('type').upper()))
|
|
||||||
if str(e.tag) == 'singleFilterComponent':
|
if str(e.tag) == 'singleFilterComponent':
|
||||||
t = e.get('type')
|
t = e.get('type')
|
||||||
if str(e.tag) == 'filterData':
|
if str(e.tag) == 'filterData':
|
||||||
|
Loading…
Reference in New Issue
Block a user