From 42e91346edc0a063dc064c17e5e8552ade10b32d Mon Sep 17 00:00:00 2001 From: Zsolt Foldvari Date: Tue, 1 Apr 2008 16:55:14 +0000 Subject: [PATCH] StyledTextTag.ranges is rather initialized as [] than None in case it is not specifically set. svn: r10444 --- src/gen/lib/styledtexttag.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gen/lib/styledtexttag.py b/src/gen/lib/styledtexttag.py index 6c8a95136..2a9e66cfb 100644 --- a/src/gen/lib/styledtexttag.py +++ b/src/gen/lib/styledtexttag.py @@ -37,7 +37,9 @@ from gen.lib.styledtexttagtype import StyledTextTagType class StyledTextTag(): """Hold formatting information for StyledText. - @ivar name: Type or name of the tag instance. E.g. bold, etc. + StyledTextTag is a container class, it's attributes are directly accessed. + + @ivar name: Type (or name) of the tag instance. E.g. 'bold', etc. @type name: L{gen.lib.StyledTextTagType} instace @ivar value: Value of the tag. E.g. color hex string for font color, etc. @type value: str or None @@ -49,7 +51,10 @@ class StyledTextTag(): """Setup initial instance variable values.""" self.name = StyledTextTagType(name) self.value = value - self.ranges = ranges + if ranges is None: + self.ranges = [] + else: + self.ranges = ranges def serialize(self): """Convert the object to a serialized tuple of data.