summaryrefslogtreecommitdiff
path: root/lib/param/int_.py
diff options
context:
space:
mode:
authorPepper <pepper@scannerjammer.com>2015-09-27 00:03:42 -0400
committerPepper <pepper@scannerjammer.com>2015-09-27 00:03:42 -0400
commit30126dfc2877a82b8af02d68ca3b155068d551dd (patch)
treea706d699cd1e1f50c2007e69d6ca9ba96819eaed /lib/param/int_.py
parentff31f2c4cf1792df351359f1749f63b3d0cce23b (diff)
done linting...just need to wrap up and publish
Diffstat (limited to 'lib/param/int_.py')
-rw-r--r--lib/param/int_.py39
1 files changed, 23 insertions, 16 deletions
diff --git a/lib/param/int_.py b/lib/param/int_.py
index b33c6b5..9d48518 100644
--- a/lib/param/int_.py
+++ b/lib/param/int_.py
@@ -1,18 +1,25 @@
-from param import Param
+"""Int class definition lives here"""
+from .param import Param
class Int(Param):
- def __init__(self, value, classname=""):
- super(Int, self).__init__(classname=classname)
- try:
- if value:
- self.value = int(value)
- else:
- self.value = 0
- except Exception as e:
- self.err_warn("Not an int: %s" % str(value))
- self.err_warn(str(e))
- def __int__(self):
- return int(self.value)
-
- def __float__(self):
- return float(self.value)
+ def __init__(self, value, classname=""):
+ """Defines the float param type
+ Args:
+ value: the value of the Int
+ classname: the name of the class to which the param belongs
+ """
+ super(Int, self).__init__(classname=classname)
+ try:
+ if value:
+ self.value = int(value)
+ else:
+ self.value = 0
+ except Exception as e:
+ self.err_warn("Not an int: %s" % str(value))
+ self.err_warn(str(e))
+
+ def __int__(self):
+ return int(self.value)
+
+ def __float__(self):
+ return float(self.value)