def testDesignerActions(self): """Prints out the longer dependency trees.""" trees = unlock_lint.build_designer_trees() for k in list(trees): t = trees[k] # if len(t.nodes) > 1: # t.show() if len(t.nodes) > 3: print t.tostring()
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")