%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/babel/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyc

�
���Qc@s�dZddlZddlmZmZddlZddlZddlZddlm	Z	m
Z
e�Zd�Z
ejdej�Zd�Zd�Zd	ejfd
��YZdddd
�Zdefd��YZyejjZWnek
rdd�ZnXdefd��YZddlZddlmZejZ ej!Z!ej"Z"ej#Z#ej$Z$ej%Z%ej&Z&dS(s�
    babel.util
    ~~~~~~~~~~

    Various utility classes and functions.

    :copyright: (c) 2013 by the Babel Team.
    :license: BSD, see LICENSE for more details.
i����N(t	timedeltattzinfo(tiziptimapccsEt�}x5t|�D]'}||kr|V|j|�qqWdS(s�Yield all items in an iterable collection that are distinct.

    Unlike when using sets for a similar effect, the original ordering of the
    items in the collection is preserved by this function.

    >>> print list(distinct([1, 2, 1, 3, 4, 4]))
    [1, 2, 3, 4]
    >>> print list(distinct('foobar'))
    ['f', 'o', 'b', 'a', 'r']

    :param iterable: the iterable collection providing the data
    N(tsettitertadd(titerabletseentitem((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pytdistincts

	s([ \t\f]* \# .* coding[=:][ \t]*([-\w.]+)cCs|j�}|jd�z�|j�}|jtj�}|rV|ttj�}ntj|�}|s�y&ddl	}|j
|jd��Wntt
fk
r�q�X|j�}tj|�}n|r�|r�t
d��ndS|r|jd�jd�SdSWd|j|�XdS(sDeduce the encoding of a source file from magic comment.

    It does this in the same way as the `Python interpreter`__

    .. __: http://docs.python.org/ref/encodings.html

    The ``fp`` argument should be a seekable file object.

    (From Jeff Dairiki)
    ii����Nslatin-1s\python refuses to compile code with both a UTF8 byte-order-mark and a magic encoding commenttutf_8i(ttelltseektreadlinet
startswithtcodecstBOM_UTF8tlentPYTHON_MAGIC_COMMENT_retmatchtparsertsuitetdecodetImportErrortSyntaxErrortgrouptNone(tfptpostline1thas_bomtmRtline2((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pytparse_encoding,s2
cCs�idd6dd6dd6dd6d	d
6dd6}g}xcttjd
|��D]I\}}|dry|j||�qO|rO|jtj|��qOqOWtjdj|�d|jtj	d��}|dk	S(sExtended pathname pattern matching.

    This function is similar to what is provided by the ``fnmatch`` module in
    the Python standard library, but:

     * can match complete (relative or absolute) path names, and not just file
       names, and
     * also supports a convenience pattern ("**") to match files at any
       directory level.

    Examples:

    >>> pathmatch('**.py', 'bar.py')
    True
    >>> pathmatch('**.py', 'foo/bar/baz.py')
    True
    >>> pathmatch('**.py', 'templates/index.html')
    False

    >>> pathmatch('**/templates/*.html', 'templates/index.html')
    True
    >>> pathmatch('**/templates/*.html', 'templates/foo/bar.html')
    False

    :param pattern: the glob pattern
    :param filename: the path name of the file to match against
    s[^/]t?s[^/]/s?/s[^/]+t*s[^/]+/s*/s	(?:.+/)*?s**/s(?:.+/)*?[^/]+s**s	([?*]+/?)itt$t/N(t	enumeratetretsplittappendtescapeRtjointreplacetostsepR(tpatterntfilenametsymbolstbuftidxtpartR((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyt	pathmatch[s
%
.tTextWrappercBseZejd�ZRS(s((\s+|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))(t__name__t
__module__R)tcompilet
wordsep_re(((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyR8�siFR%c	Cs.td|d|d|dt�}|j|�S(s�Simple wrapper around the ``textwrap.wrap`` function in the standard
    library. This version does not wrap lines on hyphens in words.

    :param text: the text to wrap
    :param width: the maximum line width
    :param initial_indent: string that will be prepended to the first line of
                           wrapped output
    :param subsequent_indent: string that will be prepended to all lines save
                              the first of wrapped output
    twidthtinitial_indenttsubsequent_indenttbreak_long_words(R8tFalsetwrap(ttextR=R>R?twrapper((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pytwraptext�s	todictcBs�eZdZdd�Zd�Zd�Zd�ZeZd�Z	d�Z
d�Zd�Zd	�Z
ed
�Zd�Zdd�Zd
�Zd�Zd�ZRS(skOrdered dict implementation.

    :see: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747
    cCs2tj||pi�ttj|��|_dS(N(tdictt__init__tlisttkeyst_keys(tselftdata((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyRH�scCs$tj||�|jj|�dS(N(RGt__delitem__RKtremove(RLtkey((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyRN�scCs9tj|||�||jkr5|jj|�ndS(N(RGt__setitem__RKR+(RLRPR	((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyRQ�scCs
t|j�S(N(RRK(RL((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyt__iter__�scCstj|�g|_dS(N(RGtclearRK(RL((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyRS�s
cCst�}|j|�|S(N(RFtupdate(RLtd((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pytcopy�s	
cCst|j|j��S(N(tzipRKtvalues(RL((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pytitems�scCst|j|j��S(N(RRKt
itervalues(RL((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyt	iteritems�scCs|jS(N(RK(RL((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyRJ�scCsO|tkrtj||�S||kr,|S|jj|�tj|||�S(N(tmissingRGtpopRKRO(RLRPtdefault((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyR]�scCs|jj|�tj|�S(N(RKRORGtpopitem(RLRP((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyR_�scCs9tj|||�||jkr5|jj|�ndS(N(RGt
setdefaultRKR+(RLRPtfailobj((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyR`�scCs+x$|j�D]\}}|||<q
WdS(N(RY(RLRGRPtval((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyRT�scCst|j|j�S(N(tmaptgetRK(RL((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyRX�scCst|j|j�S(N(RRdRK(RL((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyRZ�sN(R9R:t__doc__RRHRNRQRRtiterkeysRSRVRYR[RJR\R]R_R`RTRXRZ(((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyRF�s"											t.cCs�tjj|�jtj�}tjj|�jtj�}ttjj||g��}tjjgt|�|||}tjj|�S(s8Compute the relative path to one path from another.

        >>> relpath('foo/bar.txt', '').replace(os.sep, '/')
        'foo/bar.txt'
        >>> relpath('foo/bar.txt', 'foo').replace(os.sep, '/')
        'bar.txt'
        >>> relpath('foo/bar.txt', 'baz').replace(os.sep, '/')
        '../foo/bar.txt'
        (	R/tpathtabspathR*R0RtcommonprefixtpardirR-(Rhtstartt
start_listt	path_listtitrel_list((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pytrelpath�s

%tFixedOffsetTimezonecBsGeZdZdd�Zd�Zd�Zd�Zd�Zd�Z	RS(s&Fixed offset in minutes east from UTC.cCs8td|�|_|dkr+d|}n||_dS(Ntminutess
Etc/GMT+%d(Rt_offsetRtzone(RLtoffsettname((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyRH�s
cCs|jS(N(Ru(RL((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyt__str__scCsd|j|jfS(Ns<FixedOffset "%s" %s>(RuRt(RL((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyt__repr__scCs|jS(N(Rt(RLtdt((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyt	utcoffsetscCs|jS(N(Ru(RLRz((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyttznamescCstS(N(tZERO(RLRz((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pytdstsN(
R9R:ReRRHRxRyR{R|R~(((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyRr�s				(t	localtime('ReRtdatetimeRRR/R)ttextwrapt
babel._compatRRtobjectR\R
R;tVERBOSERR"R7R8RERGRFRhRqtAttributeErrorRrtpytzt_pytztbabelRtutctUTCtLOCALTZt
get_localzonet	STDOFFSETt	DSTOFFSETtDSTDIFFR}(((s;/opt/alt/python27/lib/python2.7/site-packages/babel/util.pyt<module>
s:			/	.D
						

Zerion Mini Shell 1.0