This commit is contained in:
parent
f070121e5c
commit
8dce1569c0
@ -72,8 +72,7 @@ class Word:
|
|||||||
style = container.style
|
style = container.style
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {
|
f"Container {type(container).__name__} must have a 'style' property")
|
||||||
type(container).__name__} must have a 'style' property")
|
|
||||||
|
|
||||||
# Inherit background from container if not provided
|
# Inherit background from container if not provided
|
||||||
if background is None and hasattr(container, 'background'):
|
if background is None and hasattr(container, 'background'):
|
||||||
@ -128,8 +127,7 @@ class Word:
|
|||||||
container.add_word(word)
|
container.add_word(word)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {
|
f"Container {type(container).__name__} must have an 'add_word' method")
|
||||||
type(container).__name__} must have an 'add_word' method")
|
|
||||||
|
|
||||||
return word
|
return word
|
||||||
|
|
||||||
@ -228,8 +226,7 @@ class FormattedSpan:
|
|||||||
style = container.style
|
style = container.style
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {
|
f"Container {type(container).__name__} must have a 'style' property")
|
||||||
type(container).__name__} must have a 'style' property")
|
|
||||||
|
|
||||||
# Inherit background from container if not provided
|
# Inherit background from container if not provided
|
||||||
if background is None and hasattr(container, 'background'):
|
if background is None and hasattr(container, 'background'):
|
||||||
@ -243,8 +240,7 @@ class FormattedSpan:
|
|||||||
container.add_span(span)
|
container.add_span(span)
|
||||||
else:
|
else:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
f"Container {
|
f"Container {type(container).__name__} must have an 'add_span' method")
|
||||||
type(container).__name__} must have an 'add_span' method")
|
|
||||||
|
|
||||||
return span
|
return span
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user