view plot_filter.py @ 1:cdb9e89e2970 draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/histogram commit a1517c9d22029095120643bbe2c8fa53754dd2b7
author devteam
date Wed, 11 Nov 2015 12:17:14 -0500
parents 6ff47de059a0
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