diff plot_filter.py @ 0:6ff47de059a0 draft

Imported from capsule None
author devteam
date Mon, 28 Jul 2014 11:56:34 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plot_filter.py	Mon Jul 28 11:56:34 2014 -0400
@@ -0,0 +1,19 @@
+
+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
+