def run_lint(request):
    """Runs unlock_lint over the DesignerActions and shows the results in a page."""
    _ = request
    trees = unlock_lint.build_designer_trees()
    sorted_trees = OrderedDict(sorted(trees.items(), key=lambda t: -len(t[1])))
    unlock_tree = ''
    for k in list(sorted_trees):
        unlock_tree += sorted_trees[k].tohtmlstring()
        unlock_tree += '<p></p>'
    unreachable = unlock_lint.get_unreachable_designer_actions()
    false_unlock = unlock_lint.get_false_unlock_designer_actions()
    mismatched_levels = unlock_lint.get_missmatched_designer_level()
    return HttpResponse(json.dumps({
            "tree": unlock_tree,
            "unreachable": unreachable,
            "false_unlock": false_unlock,
            "mismatched_levels": mismatched_levels,
            "pub_date": unlock_lint.check_pub_exp_dates(),
            }), mimetype="application/json")
Example #2
0
 def testFalseUnlock(self):
     """Returns the actions with False unlock_conditions."""
     slugs = unlock_lint.get_false_unlock_designer_actions(None)
     print "False unlock conditions: %s" % slugs
Example #3
0
 def testFalseUnlock(self):
     """Returns the actions with False unlock_conditions."""
     slugs = unlock_lint.get_false_unlock_designer_actions(None)
     print "False unlock conditions: %s" % slugs