StyledTextTag.ranges is rather initialized as [] than None

in case it is not specifically set.


svn: r10444
This commit is contained in:
Zsolt Foldvari 2008-04-01 16:55:14 +00:00
parent f90bcd5b87
commit 42e91346ed

View File

@ -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,6 +51,9 @@ class StyledTextTag():
"""Setup initial instance variable values."""
self.name = StyledTextTagType(name)
self.value = value
if ranges is None:
self.ranges = []
else:
self.ranges = ranges
def serialize(self):