Commit 5f473f76 by Victor Shnayder

small features in xml wrangling commands

parent 317e2c34
...@@ -60,7 +60,10 @@ def get_metadata(course): ...@@ -60,7 +60,10 @@ def get_metadata(course):
queue = [course] queue = [course]
while len(queue) > 0: while len(queue) > 0:
node = queue.pop() node = queue.pop()
d[policy_key(node.location)] = node_metadata(node) meta = node_metadata(node)
# Don't output empty policy for things with no metadata
if len(meta) > 0:
d[policy_key(node.location)] = meta
# want to print first children first, so put them at the end # want to print first children first, so put them at the end
# (we're popping from the end) # (we're popping from the end)
queue.extend(reversed(node.get_children())) queue.extend(reversed(node.get_children()))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment