aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/gui/app/range_list.py
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2012-02-07 00:58:28 +0000
committerMichael Elkins <melkins@tislabs.com>2012-02-07 00:58:28 +0000
commite4c5873f3c320da087d5ccd7bfa64534f97c87fc (patch)
tree6b38d310fe9ce5fa205ed044c2c25c70a636fa9c /rpkid/rpki/gui/app/range_list.py
parent7dbde51c8ee64c36ca37ada24a33afcdee2c0909 (diff)
coerce min/max value back to appropriate datum_type for the range
svn path=/branches/tk161/; revision=4296
Diffstat (limited to 'rpkid/rpki/gui/app/range_list.py')
-rwxr-xr-xrpkid/rpki/gui/app/range_list.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/rpkid/rpki/gui/app/range_list.py b/rpkid/rpki/gui/app/range_list.py
index 5fa36891..fcfcfc24 100755
--- a/rpkid/rpki/gui/app/range_list.py
+++ b/rpkid/rpki/gui/app/range_list.py
@@ -77,10 +77,16 @@ class RangeList(list):
for x in self:
xmin = x.min
+ def V(v):
+ """convert the integer value to the appropriate type for this
+ range"""
+ return x.__class__.datum_type(v)
+
try:
while xmin <= x.max:
if xmin < cur.min:
- r.append(x.__class__(min=xmin, max=min(x.max,cur.min-1)))
+ r.append(x.__class__(min=V(xmin),
+ max=V(min(x.max,cur.min-1))))
xmin = cur.max+1
elif xmin == cur.min:
xmin = cur.max+1
@@ -91,7 +97,7 @@ class RangeList(list):
cur = it.next()
except StopIteration:
- r.append(x.__class__(min=xmin, max=x.max))
+ r.append(x.__class__(min=V(xmin), max=x.max))
return r