view plot_filter.py @ 1:a60f7f660872 draft default tip

planemo upload commit 33927a87ba2eee9bf0ecdd376a66241b17b3d734
author devteam
date Tue, 13 Oct 2015 12:17:35 -0400
parents 9c0d844f4e48
children
line wrap: on
line source


def validate(incoming):
    """Validator for the plotting program"""
    
    bins = incoming.get("bins","")
    col  = incoming.get("col","")

    if not bins or not col:
        raise Exception, "You need to specify a number for bins and columns"

    try:
        bins = int(bins)
        col  = int(col)
    except:
        raise Exception, "Parameters are not valid numbers, columns:%s, bins:%s" % (col, bins)

    if not 1<bins<100:
        raise Exception, "The number of bins %s must be a number between 1 and 100" % bins