Z-jpdZddlmZddlmZddlmZ ddddd ddZ ddddd ddZ ddddd ddZ dS)zBPython grapheme, emoji, and sequence-aware ljust, rjust, center().) annotations)Literal)width parseF control_codesambiguous_width term_programtextstr dest_widthintfillcharr $Literal['parse', 'strict', 'ignore']r r bool | strreturnc|r$|rt|}nt||||}t d||z }|||zzS)u Return text left-justified in a string of given display width. :param text: String to justify, may contain terminal sequences. :param dest_width: Total display width of result in terminal cells. :param fillchar: Single character for padding (default space). Must have display width of 1 (not wide, not zero-width, not combining). Unicode characters like ``'·'`` are acceptable. The width is not validated. :param control_codes: How to handle control sequences when measuring. Passed to :func:`width` for measurement. :param ambiguous_width: Width to use for East Asian Ambiguous (A) characters. Default is ``1`` (narrow). Set to ``2`` for CJK contexts. :param term_program: Terminal software identifier for table correction. ``False`` (default) disables override lookup. ``True`` reads the ``TERM_PROGRAM`` or ``TERM`` environment variable for auto-detection. Accepts a canonical terminal name matching :func:`list_term_programs`, such as from XTVERSION_, ENQ_, or ``TERM_PROGRAM``. .. versionadded:: 0.8.0 :returns: Text padded on the right to reach ``dest_width``. .. versionadded:: 0.3.0 Example:: >>> wcwidth.ljust('hi', 5) 'hi ' >>> wcwidth.ljust('\x1b[31mhi\x1b[0m', 5) '\x1b[31mhi\x1b[0m ' >>> wcwidth.ljust('\U0001F468\u200D\U0001F469\u200D\U0001F467', 6) '👨‍👩‍👧 ' r risascii isprintablelenrmaxr rrr r r text_width padding_cellss e/home/jenkins/jenkins/workspace/simtester-sanitize/venv/lib/python3.11/site-packages/wcwidth/align.pyljustr svR ||~~6$**,,6YY 4}o(4666 : 233M (]* **c|r$|rt|}nt||||}t d||z }||z|zS)u Return text right-justified in a string of given display width. :param text: String to justify, may contain terminal sequences. :param dest_width: Total display width of result in terminal cells. :param fillchar: Single character for padding (default space). Must have display width of 1 (not wide, not zero-width, not combining). Unicode characters like ``'·'`` are acceptable. The width is not validated. :param control_codes: How to handle control sequences when measuring. Passed to :func:`width` for measurement. :param ambiguous_width: Width to use for East Asian Ambiguous (A) characters. Default is ``1`` (narrow). Set to ``2`` for CJK contexts. :param term_program: Terminal software identifier for table correction. ``False`` (default) disables override lookup. ``True`` reads the ``TERM_PROGRAM`` or ``TERM`` environment variable for auto-detection. Accepts a canonical terminal name matching :func:`list_term_programs`, such as from XTVERSION_, ENQ_, or ``TERM_PROGRAM``. .. versionadded:: 0.8.0 :returns: Text padded on the left to reach ``dest_width``. .. versionadded:: 0.3.0 Example:: >>> wcwidth.rjust('hi', 5) ' hi' >>> wcwidth.rjust('\x1b[31mhi\x1b[0m', 5) ' \x1b[31mhi\x1b[0m' >>> wcwidth.rjust('\U0001F468\u200D\U0001F469\u200D\U0001F467', 6) ' 👨‍👩‍👧' r rrrs rrjustr"<svR ||~~6$**,,6YY 4}o(4666 : 233M m #d **r c|r$|rt|}nt||||}t d||z }|dz||zdzz}||z } ||z|z|| zzS)u Return text centered in a string of given display width. :param text: String to center, may contain terminal sequences. :param dest_width: Total display width of result in terminal cells. :param fillchar: Single character for padding (default space). Must have display width of 1 (not wide, not zero-width, not combining). Unicode characters like ``'·'`` are acceptable. The width is not validated. :param control_codes: How to handle control sequences when measuring. Passed to :func:`width` for measurement. :param ambiguous_width: Width to use for East Asian Ambiguous (A) characters. Default is ``1`` (narrow). Set to ``2`` for CJK contexts. :param term_program: Terminal software identifier for table correction. ``False`` (default) disables override lookup. ``True`` reads the ``TERM_PROGRAM`` or ``TERM`` environment variable for auto-detection. Accepts a canonical terminal name matching :func:`list_term_programs`, such as from XTVERSION_, ENQ_, or ``TERM_PROGRAM``. .. versionadded:: 0.8.0 :returns: Text padded on both sides to reach ``dest_width``. For odd-width padding, the extra cell fills in the same cell position as Python's :meth:`str.center` behavior (the left side when ``dest_width`` is odd, the right side when ``dest_width`` is even). See `the eccentric str.center `_. .. versionadded:: 0.3.0 Example:: >>> wcwidth.center('hi', 6) ' hi ' >>> wcwidth.center('\x1b[31mhi\x1b[0m', 6) ' \x1b[31mhi\x1b[0m ' >>> wcwidth.center('\U0001F468\u200D\U0001F469\u200D\U0001F467', 6) ' 👨‍👩‍👧 ' r rrr) r rrr r r r total_paddingleft_pad right_pads rcenterr(ns\ ||~~6$**,,6YY 4}o(4666 : 233M!]Z%?!%CDH(I h  %9(< <r.sHH"""""" /+ ;B$/+/+/+/+/+/+j/+ ;B$/+/+/+/+/+/+j7= ;B$7=7=7=7=7=7=7=7=r