)L i dZddlmZddlmZmZddlmZddlm Z gdZ GddZ Gd d e Z Gd d e Z Gdde Zy)z' Clipboard for command line interface. ) annotations)ABCMetaabstractmethod)Callable) SelectionType) Clipboard ClipboardDataDummyClipboardDynamicClipboardc<eZdZdZdej f ddZy)r z{ Text on the clipboard. :param text: string :param type: :class:`~prompt_toolkit.selection.SelectionType` c ||_||_yN)texttype)selfrrs c/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/prompt_toolkit/clipboard/base.py__init__zClipboardData.__init__s  N)rstrrrreturnNone)__name__ __module__ __qualname____doc__r CHARACTERSrrrr r s1M4L4L$1 rr cDeZdZdZeddZddZd dZed dZy) rz Abstract baseclass for clipboards. (An implementation can be in memory, it can share the X11 or Windows keyboard, or can be persistent.) cy)ze Set data to the clipboard. :param data: :class:`~.ClipboardData` instance. Nrrdatas rset_datazClipboard.set_data*rc8|jt|y)z? Shortcut for setting plain text on clipboard. N)r#r rrs rset_textzClipboard.set_text2s mD)*rcy)z7 For Emacs mode, rotate the kill ring. Nrrs rrotatezClipboard.rotate8r$rcy)z( Return clipboard data. Nrr)s rget_datazClipboard.get_data=r$rNr"r rrrrrrrrrr ) rrrrrr#r'r*r,rrrrr#s9   +    rr) metaclassc0eZdZdZddZddZd dZd dZy) r zB Clipboard implementation that doesn't remember anything. cyrrr!s rr#zDummyClipboard.set_dataI rcyrrr&s rr'zDummyClipboard.set_textLr4rcyrrr)s rr*zDummyClipboard.rotateOr4rctSr)r r)s rr,zDummyClipboard.get_dataRs rNr-r.r/r0)rrrrr#r'r*r,rrrr r Ds   rr c@eZdZdZd dZd dZd dZd dZd dZddZ y)r z Clipboard class that can dynamically returns any Clipboard. :param get_clipboard: Callable that returns a :class:`.Clipboard` instance. c||_yr) get_clipboard)rr:s rrzDynamicClipboard.__init__]s *rc:|jxs tSr)r:r r)s r _clipboardzDynamicClipboard._clipboard`s!!#7~'77rcB|jj|yr)r<r#r!s rr#zDynamicClipboard.set_datac ""4(rcB|jj|yr)r<r'r&s rr'zDynamicClipboard.set_textfr>rc@|jjyr)r<r*r)s rr*zDynamicClipboard.rotateis   "rc>|jjSr)r<r,r)s rr,zDynamicClipboard.get_datals ))++rN)r:zCallable[[], Clipboard | None]rr)rrr-r.r/r0) rrrrrr<r#r'r*r,rrrr r Vs% +8))#,rr N)r __future__rabcrrtypingrprompt_toolkit.selectionr__all__r rr r rrrrGsN#'2    ' BY$,y,r