StyledTextTag.ranges is rather initialized as [] than None
in case it is not specifically set. svn: r10444
This commit is contained in:
parent
f90bcd5b87
commit
42e91346ed
@ -37,7 +37,9 @@ from gen.lib.styledtexttagtype import StyledTextTagType
|
|||||||
class StyledTextTag():
|
class StyledTextTag():
|
||||||
"""Hold formatting information for StyledText.
|
"""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
|
@type name: L{gen.lib.StyledTextTagType} instace
|
||||||
@ivar value: Value of the tag. E.g. color hex string for font color, etc.
|
@ivar value: Value of the tag. E.g. color hex string for font color, etc.
|
||||||
@type value: str or None
|
@type value: str or None
|
||||||
@ -49,6 +51,9 @@ class StyledTextTag():
|
|||||||
"""Setup initial instance variable values."""
|
"""Setup initial instance variable values."""
|
||||||
self.name = StyledTextTagType(name)
|
self.name = StyledTextTagType(name)
|
||||||
self.value = value
|
self.value = value
|
||||||
|
if ranges is None:
|
||||||
|
self.ranges = []
|
||||||
|
else:
|
||||||
self.ranges = ranges
|
self.ranges = ranges
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user