def checklines(mod, errs, check_layers, check_width):
    line_types = ("fp_line", "fp_circle", "fp_arc", "fp_poly", "fp_curve")
    for line in (node for node in mod if node[0] in line_types):
        layer = [n for n in line if n[0] == "layer"][0]
        width = [n for n in line if n[0] == "width"][0]
        if layer[1] in check_layers:
            if Decimal(width[1]) != Decimal(check_width):
                errs.append("Lines on {} must be {}mm wide"
                            .format(check_layers, check_width))