fix bugs in GenericText
This commit is contained in:
parent
189e0178c4
commit
80036d3dda
1 changed files with 6 additions and 4 deletions
|
@ -86,12 +86,14 @@ class GenericText:
|
||||||
def __add__(self, other):
|
def __add__(self, other):
|
||||||
if not self.has_value():
|
if not self.has_value():
|
||||||
return other
|
return other
|
||||||
if not other.has_value():
|
|
||||||
return self
|
|
||||||
if isinstance(other, GenericText):
|
if isinstance(other, GenericText):
|
||||||
|
if not other.has_value():
|
||||||
|
return self
|
||||||
return GenericText(self.text + other.text)
|
return GenericText(self.text + other.text)
|
||||||
else:
|
else:
|
||||||
return GenericText(self.text + other)
|
return GenericText(self.text + other)
|
||||||
|
|
||||||
def __iadd__(self, other):
|
def __radd__(self, other):
|
||||||
self.text = self + other
|
if other is None:
|
||||||
|
return self
|
||||||
|
return other + self
|
||||||
|
|
Loading…
Reference in a new issue