From 852a85d2b60b06bfcc505c08492a015db331cfe9 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Sun, 27 Jan 2008 21:15:12 +0000 Subject: [PATCH] display hex values unsigned --- lib/python/Screens/ServiceInfo.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/python/Screens/ServiceInfo.py b/lib/python/Screens/ServiceInfo.py index 7bd8aa98..00adc74d 100644 --- a/lib/python/Screens/ServiceInfo.py +++ b/lib/python/Screens/ServiceInfo.py @@ -14,6 +14,9 @@ TYPE_VALUE_DEC = 2 TYPE_VALUE_HEX_DEC = 3 TYPE_SLIDER = 4 +def to_unsinged(x): + return x & 0xFFFFFFFF + def ServiceInfoListEntry(a, b, valueType=TYPE_TEXT, param=4): res = [ ] @@ -23,11 +26,11 @@ def ServiceInfoListEntry(a, b, valueType=TYPE_TEXT, param=4): print "b:", b if type(b) is not str: if valueType == TYPE_VALUE_HEX: - b = ("0x%0" + str(param) + "x") % b + b = ("0x%0" + str(param) + "x") % to_unsigned(b) elif valueType == TYPE_VALUE_DEC: b = str(b) elif valueType == TYPE_VALUE_HEX_DEC: - b = ("0x%0" + str(param) + "x (%dd)") % (b, b) + b = ("0x%0" + str(param) + "x (%dd)") % (to_unsigned(b), b) else: b = str(b) -- 2.30.2