Anons79 Mini Shell

Directory : /usr/lib/python2.7/site-packages/dnf/cli/
Upload File :
Current File : //usr/lib/python2.7/site-packages/dnf/cli/term.pyo

�
�[/\c@@s�ddlmZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
dd�Zdd�Zde
fd��YZdS(	i(tabsolute_import(tunicode_literalsNicC@sUy<d}tj|tj|�}tjd|�d}|SWntk
rPdSXdS(u Get the real terminal width uabcdefghthhhhiN(tfcntltioctlttermiost
TIOCGWINSZtstructtunpacktIOErrortNone(tfdtbuftret((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pyt_real_term_widths
cC@s1tdd�}|sdS|dkr)dS|SdS(u@ Compute terminal width falling to default 80 in case of troubleRiiPiN(R(Rttw((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pyt_term_width)stTermcB@s�eZdZeZed��Zed��Zidd6dd6dd6Zid	d
6dd6d
d6dd6dd6dd6dd6dd6Z	id	d
6dd6d
d6dd6dd6dd6dd6dd6Z
idd6dd6dd6dd6d d6d!d6Zid"d
6d#d6d$d6d%d6d&d6d'd6d(d6d)d6Zid*d
6d+d6d,d6d-d6d.d6d/d6d0d6d1d6Z
d2�Zd?d3d4�Zd?d3d5�Zd6�Zd7�Zd8�Zd?ed9�Zd:�Zd;�Zd<�Zd=�Zd>�ZRS(@u>A class to provide some terminal "UI" helpers based on curses.cC@st�S(N(R(tself((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pyt<lambda>@scC@st�S(N(R(R((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pyRAsusmulu	underlineurevureverseusgr0unormaliublackiublueiugreeniucyaniurediumagentaiuyellowiuwhiteuubolduublinkuudimuuu(BuuuuuuuuuuuuuuuucC@s(|j|_|j|_|j|_dS(N(t_Term__ansi_forced_MODEtMODEt_Term__ansi_forced_FG_COLORtFG_COLORt_Term__ansi_forced_BG_COLORtBG_COLOR(R((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pyt
__forced_initzsuautocC@srt|_d|_|dkr,|j�dSidd6dd6dd6dd6dd	6dd
6|_idd6dd6dd
6dd6dd6dd6dd6dd6|_idd6dd6dd
6dd6dd6dd6dd6dd6|_|dkr�t|_dS|stj	}n|j
�s%t|_dSytjd|j
��Wntk
r\t|_dSXtj|_tjd�|_xL|jD]A}|}||jkr�|j|}n|j|�|j|<q�W|jd�jd�}|r0xE|jj�D]1\}}tj||�j�pd|j|<q�Wn|jd�jd�}|r�xK|jj�D]7\}}tj||�j�p�d}||j|<q^Wn|jd�jd�}	|	rxE|jj�D]1\}}tj|	|�j�p�d|j|<q�Wn|jd�jd�}
|
rnxK|jj�D]7\}}tj|
|�j�pWd}||j|<q0WndS(u
Reinitializes the :class:`Term`.

        :param term_stream:  the terminal stream that the
           :class:`Term` should be initialized to use.  If
           *term_stream* is not given, :attr:`sys.stdout` is used.
        :param color: when to colorize output.  Valid values are
           'always', 'auto', and 'never'.  'always' will use ANSI codes
           to always colorize output, 'auto' will decide whether do
           colorize depending on the terminal, and 'never' will never
           colorize.
        iualwaysNuuboldublinkudimureverseu	underlineunormalublackublueugreenucyanuredumagentauyellowuwhiteuneverRulinesusetfuutf-8usetafusetbusetab(tTruet_Term__enabledtlinest_Term__forced_initRRRtFalsetsyststdouttisattytcursest	setuptermtfilenot	Exceptionttigetstrt
_ctigetstrttigetnumt_Term__cap_namest	_tigetstrtencodet
_Term__colorstitemsttparmtdecodet_Term__ansi_colors(Rtterm_streamtcolortcap_nametmodetset_fgtvaltset_fg_ansitfg_colortset_bgtset_bg_ansitbg_color((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pytreinits�		



		
	,,cC@s|j||�dS(N(R=(RR2R3((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pyt__init__�scC@sI|j|�pd}tjj|�r6|j�}ntjdd|�S(Nuu\$<\d+>[/*]?(R(tdnftpycomptis_py3bytesR0tretsub(RR4tcap((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pyR+�scC@s |j|t|�|jdS(uColorize string with colorunormal(Rtstr(RR3ts((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pyR3�scC@s|jd|�S(uMake string bold.ubold(R3(RRF((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pytbold�sc
@s�|js
|S|stj}n��fd�}xM|D]E}||�}	|rhtj|	tj�}	ntj|	||�}q8W|S(uSearch the string *haystack* for all occurrences of any
        string in the list *needles*.  Prefix each occurrence with
        *beg*, and postfix each occurrence with *end*, then return the
        modified string.  For example::

           >>> yt = Term()
           >>> yt.sub('spam and eggs', 'x', 'z', ['and'])
           'spam xandz eggs'

        This is particularly useful for emphasizing certain words
        in output: for example, calling :func:`sub` with *beg* =
        MODE['bold'] and *end* = MODE['normal'] will return a string
        that when printed to the terminal will appear to be *haystack*
        with each occurrence of the strings in *needles* in bold
        face.  Note, however, that the :func:`sub_mode`,
        :func:`sub_bold`, :func:`sub_fg`, and :func:`sub_bg` methods
        provide convenient ways to access this same emphasizing functionality.

        :param haystack: the string to be modified
        :param beg: the string to be prefixed onto matches
        :param end: the string to be postfixed onto matches
        :param needles: a list of strings to add the prefixes and
           postfixes to
        :param escape: a function that accepts a string and returns
           the same string with problematic characters escaped.  By
           default, :func:`re.escape` is used.
        :param ignore_case: whether case should be ignored when
           searching for matches
        :return: *haystack* with *beg* prefixing, and *end*
          postfixing, occurrences of the strings in *needles*
        c@s�|j��S(N(tgroup(tmatch(tbegtend(s0/usr/lib/python2.7/site-packages/dnf/cli/term.pyRs(RRBtescapettemplatetIRC(
RthaystackRJRKtneedlesRLtignore_casetrendertneedletpat((RJRKs0/usr/lib/python2.7/site-packages/dnf/cli/term.pyRC�s 	
cK@s |j|||jd||�S(uOSearch the string *haystack* for all occurrences of any
        string in the list *needles*.  Prefix each occurrence with
        *beg*, and postfix each occurrence with self.MODE['normal'],
        then return the modified string.  If *beg* is an ANSI escape
        code, such as given by self.MODE['bold'], this method will
        return *haystack* with the formatting given by the code only
        applied to the strings in *needles*.

        :param haystack: the string to be modified
        :param beg: the string to be prefixed onto matches
        :param end: the string to be postfixed onto matches
        :param needles: a list of strings to add the prefixes and
           postfixes to
        :return: *haystack* with *beg* prefixing, and self.MODE['normal']
          postfixing, occurrences of the strings in *needles*
        unormal(RCR(RRORJRPtkwds((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pytsub_norm&scK@s|j||j|||�S(uTSearch the string *haystack* for all occurrences of any
        string in the list *needles*.  Prefix each occurrence with
        self.MODE[*mode*], and postfix each occurrence with
        self.MODE['normal'], then return the modified string.  This
        will return a string that when printed to the terminal will
        appear to be *haystack* with each occurrence of the strings in
        *needles* in the given *mode*.

        :param haystack: the string to be modified
        :param mode: the mode to set the matches to be in.  Valid
           values are given by self.MODE.keys().
        :param needles: a list of strings to add the prefixes and
           postfixes to
        :return: *haystack* with self.MODE[*mode*] prefixing, and
          self.MODE['normal'] postfixing, occurrences of the strings
          in *needles*
        (RVR(RROR5RPRU((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pytsub_mode9scK@s|j|d||�S(u�Search the string *haystack* for all occurrences of any
        string in the list *needles*.  Prefix each occurrence with
        self.MODE['bold'], and postfix each occurrence with
        self.MODE['normal'], then return the modified string.  This
        will return a string that when printed to the terminal will
        appear to be *haystack* with each occurrence of the strings in
        *needles* in bold face.

        :param haystack: the string to be modified
        :param needles: a list of strings to add the prefixes and
           postfixes to
        :return: *haystack* with self.MODE['bold'] prefixing, and
          self.MODE['normal'] postfixing, occurrences of the strings
          in *needles*
        ubold(RW(RRORPRU((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pytsub_boldMscK@s|j||j|||�S(ucSearch the string *haystack* for all occurrences of any
        string in the list *needles*.  Prefix each occurrence with
        self.FG_COLOR[*color*], and postfix each occurrence with
        self.MODE['normal'], then return the modified string.  This
        will return a string that when printed to the terminal will
        appear to be *haystack* with each occurrence of the strings in
        *needles* in the given color.

        :param haystack: the string to be modified
        :param color: the color to set the matches to be in.  Valid
           values are given by self.FG_COLOR.keys().
        :param needles: a list of strings to add the prefixes and
           postfixes to
        :return: *haystack* with self.FG_COLOR[*color*] prefixing, and
          self.MODE['normal'] postfixing, occurrences of the strings
          in *needles*
        (RVR(RROR3RPRU((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pytsub_fg_scK@s|j||j|||�S(u�Search the string *haystack* for all occurrences of any
        string in the list *needles*.  Prefix each occurrence with
        self.BG_COLOR[*color*], and postfix each occurrence with
        self.MODE['normal'], then return the modified string.  This
        will return a string that when printed to the terminal will
        appear to be *haystack* with each occurrence of the strings in
        *needles* highlighted in the given background color.

        :param haystack: the string to be modified
        :param color: the background color to set the matches to be in.  Valid
           values are given by self.BG_COLOR.keys().
        :param needles: a list of strings to add the prefixes and
           postfixes to
        :return: *haystack* with self.BG_COLOR[*color*] prefixing, and
          self.MODE['normal'] postfixing, occurrences of the strings
          in *needles*
        (RVR(RROR3RPRU((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pytsub_bgssN(t__name__t
__module__t__doc__RRtpropertytreal_columnstcolumnsR*R-R1RRRRR
R=R>R+R3RGRRCRVRWRXRYRZ(((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pyR4s~	





	f				-				(t
__future__RRR#t
dnf.pycompR?RRBRR RRRtobjectR(((s0/usr/lib/python2.7/site-packages/dnf/cli/term.pyt<module>s

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]