@@ -737,6 +737,8 @@ def ljustify_text(text: str, *, fill_char: str = ' ', width: Optional[int] = Non
737
737
:param tab_width: any tabs in the text will be replaced with this many spaces. if fill_char is a tab, then it will
738
738
be converted to a space.
739
739
:return: left-justified text
740
+ :raises: TypeError if fill_char is more than one character
741
+ ValueError if text or fill_char contains an unprintable character
740
742
"""
741
743
return align_text (text , fill_char = fill_char , width = width ,
742
744
tab_width = tab_width , alignment = TextAlignment .LEFT )
@@ -754,6 +756,8 @@ def center_text(text: str, *, fill_char: str = ' ', width: Optional[int] = None,
754
756
:param tab_width: any tabs in the text will be replaced with this many spaces. if fill_char is a tab, then it will
755
757
be converted to a space.
756
758
:return: centered text
759
+ :raises: TypeError if fill_char is more than one character
760
+ ValueError if text or fill_char contains an unprintable character
757
761
"""
758
762
return align_text (text , fill_char = fill_char , width = width ,
759
763
tab_width = tab_width , alignment = TextAlignment .CENTER )
@@ -771,6 +775,8 @@ def rjustify_text(text: str, *, fill_char: str = ' ', width: Optional[int] = Non
771
775
:param tab_width: any tabs in the text will be replaced with this many spaces. if fill_char is a tab, then it will
772
776
be converted to a space.
773
777
:return: right-justified text
778
+ :raises: TypeError if fill_char is more than one character
779
+ ValueError if text or fill_char contains an unprintable character
774
780
"""
775
781
return align_text (text , fill_char = fill_char , width = width ,
776
782
tab_width = tab_width , alignment = TextAlignment .RIGHT )
0 commit comments