summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2012-06-22 09:01:30 +0200
committerFlorian Bruhin <me@the-compiler.org>2012-06-22 09:01:30 +0200
commit34f01ec0f2b0c17da5357f7e8913adc08025d5ab (patch)
treeb6cc66be1e1741f3b8aa860be203b4b2cd77baf1
parent42024b77b06007709a44995820b0342aa1b7ef62 (diff)
downloadxdd2esi-34f01ec0f2b0c17da5357f7e8913adc08025d5ab.tar.gz
xdd2esi-34f01ec0f2b0c17da5357f7e8913adc08025d5ab.zip
Rewrap
-rw-r--r--xddlib.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/xddlib.py b/xddlib.py
index dcc2220..77d23e2 100644
--- a/xddlib.py
+++ b/xddlib.py
@@ -298,13 +298,11 @@ def _convert_cast_attribute(obj, label, units):
try:
newvalue = convfunc(value)
except (ValueError, KeyError):
- warnings.warn("{}={} in {} is not a valid {}!".format(label,
- value, obj, unit), CastConvertWarning)
+ warnings.warn("{}={} in {} is not a valid {}!".format(label, value,
+ obj, unit), CastConvertWarning)
except TypeError: # None
- #warnings.warn("Can't convert {}={} in {} to {}!".format(label,
- # value, obj, unit), NoCastConvertFunctionWarning)
- warnings.warn("Can't convert {}={} to {}!".format(label, value,
- unit), NoCastConvertFunctionWarning)
+ warnings.warn("Can't convert {}={} to {}!".format(label, value, unit),
+ NoCastConvertFunctionWarning)
newvalue = value
setattr(obj, label, newvalue)
@@ -315,8 +313,8 @@ def _convert_cast_get_unit(obj, unit, value):
if unit == 'dt': # If the unit is 'dt', get the real unit from the
# datatype
newunit = obj.datatype.type_
- # The datatype doesn't know hexint, but if an integer starts with
- # '0x' it's hexadecimal.
+ # The datatype doesn't know hexint, but if an integer starts with '0x'
+ # it's hexadecimal.
if (newunit == 'integer') and value.startswith('0x'):
newunit = 'hexint'
else: # unit is already right