Skip to content
Browse files

Add validators to export.

  • Loading branch information...
1 parent 3d15a2f commit f794d333f2b1435806fe171622c62e063ded6c87 @tomthorogood committed Aug 23, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 cli/mogu_py/exportdb.py
View
14 cli/mogu_py/exportdb.py
@@ -61,7 +61,13 @@ def export_widget_policy(db,policy):
db.hgetall(policy)
)
-
+def export_validator(db, validator):
+ validator_name = validator.replace("validators.","")
+ return dict_to_string(
+ "validators",
+ validator_name,
+ db.hgetall(validator)
+ )
def export_widget_events(db,widget):
event_nodes = db.keys("%s.events.*" %widget)
if (len(event_nodes) is 0):
@@ -173,6 +179,12 @@ def export(db, filename):
output = export_perspective(db,perspective)
f.write(output)
+ validators = db.keys("validators.*")
+ for validator in validators:
+ output = export_validator(db, validator)
+ if "\"" in output:
+ f.write(output)
+
global_events = db.keys("events.*")
for event in global_events:
title = dict_entry_line("global_events", event.replace("events.",""))

0 comments on commit f794d33

Please sign in to comment.
Something went wrong with that request. Please try again.