Skip to content

Commit 0fce2c8

Browse files
committed
Store 'f' attribute so 'view source XML' in FF can work
1 parent 220466d commit 0fce2c8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

utils/make-sqlite.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ def nomes_all(where=sys.argv[1:]):
5959
# pointing into the ruleset table.
6060
etree.strip_tags(tree,'target')
6161

62+
# Store the filename in the `f' attribute so "view source XML" for rules in
63+
# FF version can find it.
64+
try:
65+
tree.xpath("/ruleset")[0].attrib["f"] = os.path.basename(fi)
66+
except Exception as oops:
67+
print "Error setting attribute: f=", os.path.basename(fi), oops
68+
6269
ruleset_name = tree.xpath("/ruleset/@name")[0]
6370
c.execute('''INSERT INTO rulesets (name, contents) VALUES(?, ?)''', (ruleset_name, etree.tostring(tree)));
6471
ruleset_id = c.lastrowid

0 commit comments

Comments
 (0)