changeset 94:b5aea10e611d

wip
author Jeff Hammel <k0scist@gmail.com>
date Mon, 02 Mar 2015 19:24:26 -0800
parents b755a8d946de
children a027870e7a93
files numerics/text_display.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/numerics/text_display.py	Mon Mar 02 18:35:16 2015 -0800
+++ b/numerics/text_display.py	Mon Mar 02 19:24:26 2015 -0800
@@ -42,6 +42,10 @@
         """validate options"""
         if options.width < 1:
             self.error("Width must be greater than zero (You gave: {})".format(options.width))
+        out_of_range = [i for i in options.fraction
+                        if not (0. < i < 1.)]
+        if out_of_range:
+            self.error("Fractions should be between 0 and 1")
 
 def main(args=sys.argv[1:]):
     """CLI"""