Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
__init__.py53 linesDownload Raw Back to wcwidth
1"""2Python 'wcwidth' module.3 4https://github.com/jquast/wcwidth5"""6 7# re-export common and outermost functions & definitions, even a few private8# ones, some for convenience, others for legacy, only the items in __all__ are9# documented as public API10 11# local12from ._clip import clip13from .align import ljust, rjust, center14from ._width import width15from .bisearch import bisearch as _bisearch16from .grapheme import iter_graphemes, iter_graphemes_reverse, grapheme_boundary_before17from .textwrap import SequenceTextWrapper, wrap18from ._wcswidth import wcswidth19from .hyperlink import Hyperlink, HyperlinkParams20from .sgr_state import propagate_sgr21from .table_vs16 import VS16_NARROW_TO_WIDE22from .table_wide import WIDE_EASTASIAN23from .table_zero import ZERO_WIDTH24from .text_sizing import TextSizing, TextSizingParams25from .table_ambiguous import AMBIGUOUS_EASTASIAN26from .escape_sequences import iter_sequences, strip_sequences27from .unicode_versions import list_versions28 29# Pre-import the legacy submodule so that sys.modules['wcwidth.wcwidth'] is30# populated during package initialization.  This matches the 0.6.0 behavior31# where ``from .wcwidth import wcwidth`` would have already loaded the32# submodule.  Without this, a later ``import wcwidth.wcwidth`` triggers33# on-disk file discovery which rebinds wcwidth.wcwidth from the function to34# the module object.35#36# NOTE: this sort order is important for legacy import API compatibility before release 0.7.037from . import wcwidth as _wcwidth_module  # isort:skip38from ._wcwidth import wcwidth, _wcmatch_version, _wcversion_value  # isort:skip39 40 41# The __all__ attribute defines the items exported from statement,42# 'from wcwidth import *', but also to say, "This is the public API".43__all__ = ('wcwidth', 'wcswidth', 'width', 'iter_sequences', 'iter_graphemes',44           'iter_graphemes_reverse', 'grapheme_boundary_before',45           'ljust', 'rjust', 'center', 'wrap', 'clip', 'strip_sequences',46           'list_versions', 'propagate_sgr', 'Hyperlink', 'HyperlinkParams',47           'TextSizing', 'TextSizingParams')48 49# Using 'hatchling', it does not seem to provide the pyproject.toml nicety, "dynamic = ['version']"50# like flit_core, maybe there is some better way but for now we have to duplicate it in both places51# Prefer the installed distribution version when available (helps test environments)52__version__ = '0.7.0'  # don't forget to also update pyproject.toml:version53 
codekingpro/portable-devtools · Team Ai