• File: UserString.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/proc/self/root/proc/self/root/opt/alt/python27/lib64/python2.7/UserString.pyc
  • Date Modified: 10/26/2026 8:10 PM
  • File size: 15.38 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

jc@sdZddlZddlZddgZdejfdYZdeejfdYZedkrddl	Z	e	j
jejd\Z
Ze	j
je\ZZd	ejkrdd
lmZde_nedejndS(sA user-defined wrapper around string objects

Note: string objects have grown methods in Python 1.6
This module requires Python 1.6 or later.
iNt
UserStringt
MutableStringcBsoeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZeZdZdZdZdejdZd;d;dZd;d;dZdejdZddZdejdZdejdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(d%Z)d&Z*d'Z+d;d(Z,d)Z-d*d+Z.dejd,Z/dejd-Z0d.Z1d/Z2d;d0Z3d;d*d1Z4d;d*d2Z5dd3Z6dejd4Z7d;d5Z8d6Z9d7Z:d8Z;d9Z<d:Z=RS(<cCsMt|tr||_n.t|tr:|j|_nt||_dS(N(t
isinstancet
basestringtdataRtstr(tselftseq((s//opt/alt/python27/lib64/python2.7/UserString.pyt__init__s
cCs
t|jS(N(RR(R((s//opt/alt/python27/lib64/python2.7/UserString.pyt__str__tcCs
t|jS(N(treprR(R((s//opt/alt/python27/lib64/python2.7/UserString.pyt__repr__R
cCs
t|jS(N(tintR(R((s//opt/alt/python27/lib64/python2.7/UserString.pyt__int__R
cCs
t|jS(N(tlongR(R((s//opt/alt/python27/lib64/python2.7/UserString.pyt__long__R
cCs
t|jS(N(tfloatR(R((s//opt/alt/python27/lib64/python2.7/UserString.pyt	__float__R
cCs
t|jS(N(tcomplexR(R((s//opt/alt/python27/lib64/python2.7/UserString.pyt__complex__R
cCs
t|jS(N(thashR(R((s//opt/alt/python27/lib64/python2.7/UserString.pyt__hash__R
cCs6t|tr"t|j|jSt|j|SdS(N(RRtcmpR(Rtstring((s//opt/alt/python27/lib64/python2.7/UserString.pyt__cmp__scCs
||jkS(N(R(Rtchar((s//opt/alt/python27/lib64/python2.7/UserString.pyt__contains__"scCs
t|jS(N(tlenR(R((s//opt/alt/python27/lib64/python2.7/UserString.pyt__len__%R
cCs|j|j|S(N(t	__class__R(Rtindex((s//opt/alt/python27/lib64/python2.7/UserString.pyt__getitem__&R
cCs5t|d}t|d}|j|j||!S(Ni(tmaxRR(Rtstarttend((s//opt/alt/python27/lib64/python2.7/UserString.pyt__getslice__'scCsgt|tr&|j|j|jSt|trI|j|j|S|j|jt|SdS(N(RRRRRR(Rtother((s//opt/alt/python27/lib64/python2.7/UserString.pyt__add__+s
cCsAt|tr#|j||jS|jt||jSdS(N(RRRRR(RR%((s//opt/alt/python27/lib64/python2.7/UserString.pyt__radd__2scCs|j|j|S(N(RR(Rtn((s//opt/alt/python27/lib64/python2.7/UserString.pyt__mul__7scCs|j|j|S(N(RR(Rtargs((s//opt/alt/python27/lib64/python2.7/UserString.pyt__mod__:scCs|j|jjS(N(RRt
capitalize(R((s//opt/alt/python27/lib64/python2.7/UserString.pyR,>R
cGs|j|jj||S(N(RRtcenter(RtwidthR*((s//opt/alt/python27/lib64/python2.7/UserString.pyR-?sicCs|jj|||S(N(Rtcount(RtsubR"R#((s//opt/alt/python27/lib64/python2.7/UserString.pyR/AscCs^|rD|r(|j|jj||S|j|jj|Sn|j|jjSdS(N(RRtdecode(Rtencodingterrors((s//opt/alt/python27/lib64/python2.7/UserString.pyR1Cs
cCs^|rD|r(|j|jj||S|j|jj|Sn|j|jjSdS(N(RRtencode(RR2R3((s//opt/alt/python27/lib64/python2.7/UserString.pyR4Ks
cCs|jj|||S(N(Rtendswith(RtsuffixR"R#((s//opt/alt/python27/lib64/python2.7/UserString.pyR5SsicCs|j|jj|S(N(RRt
expandtabs(Rttabsize((s//opt/alt/python27/lib64/python2.7/UserString.pyR7UscCs|jj|||S(N(Rtfind(RR0R"R#((s//opt/alt/python27/lib64/python2.7/UserString.pyR9WscCs|jj|||S(N(RR(RR0R"R#((s//opt/alt/python27/lib64/python2.7/UserString.pyRYscCs
|jjS(N(Rtisalpha(R((s//opt/alt/python27/lib64/python2.7/UserString.pyR:[R
cCs
|jjS(N(Rtisalnum(R((s//opt/alt/python27/lib64/python2.7/UserString.pyR;\R
cCs
|jjS(N(Rt	isdecimal(R((s//opt/alt/python27/lib64/python2.7/UserString.pyR<]R
cCs
|jjS(N(Rtisdigit(R((s//opt/alt/python27/lib64/python2.7/UserString.pyR=^R
cCs
|jjS(N(Rtislower(R((s//opt/alt/python27/lib64/python2.7/UserString.pyR>_R
cCs
|jjS(N(Rt	isnumeric(R((s//opt/alt/python27/lib64/python2.7/UserString.pyR?`R
cCs
|jjS(N(Rtisspace(R((s//opt/alt/python27/lib64/python2.7/UserString.pyR@aR
cCs
|jjS(N(Rtistitle(R((s//opt/alt/python27/lib64/python2.7/UserString.pyRAbR
cCs
|jjS(N(Rtisupper(R((s//opt/alt/python27/lib64/python2.7/UserString.pyRBcR
cCs|jj|S(N(Rtjoin(RR((s//opt/alt/python27/lib64/python2.7/UserString.pyRCdR
cGs|j|jj||S(N(RRtljust(RR.R*((s//opt/alt/python27/lib64/python2.7/UserString.pyRDescCs|j|jjS(N(RRtlower(R((s//opt/alt/python27/lib64/python2.7/UserString.pyREgR
cCs|j|jj|S(N(RRtlstrip(Rtchars((s//opt/alt/python27/lib64/python2.7/UserString.pyRFhR
cCs|jj|S(N(Rt	partition(Rtsep((s//opt/alt/python27/lib64/python2.7/UserString.pyRHisicCs|j|jj|||S(N(RRtreplace(Rtoldtnewtmaxsplit((s//opt/alt/python27/lib64/python2.7/UserString.pyRJkscCs|jj|||S(N(Rtrfind(RR0R"R#((s//opt/alt/python27/lib64/python2.7/UserString.pyRNmscCs|jj|||S(N(Rtrindex(RR0R"R#((s//opt/alt/python27/lib64/python2.7/UserString.pyROoscGs|j|jj||S(N(RRtrjust(RR.R*((s//opt/alt/python27/lib64/python2.7/UserString.pyRPqscCs|jj|S(N(Rt
rpartition(RRI((s//opt/alt/python27/lib64/python2.7/UserString.pyRQsscCs|j|jj|S(N(RRtrstrip(RRG((s//opt/alt/python27/lib64/python2.7/UserString.pyRRuR
cCs|jj||S(N(Rtsplit(RRIRM((s//opt/alt/python27/lib64/python2.7/UserString.pyRSvscCs|jj||S(N(Rtrsplit(RRIRM((s//opt/alt/python27/lib64/python2.7/UserString.pyRTxscCs|jj|S(N(Rt
splitlines(Rtkeepends((s//opt/alt/python27/lib64/python2.7/UserString.pyRUzR
cCs|jj|||S(N(Rt
startswith(RtprefixR"R#((s//opt/alt/python27/lib64/python2.7/UserString.pyRW{scCs|j|jj|S(N(RRtstrip(RRG((s//opt/alt/python27/lib64/python2.7/UserString.pyRY}R
cCs|j|jjS(N(RRtswapcase(R((s//opt/alt/python27/lib64/python2.7/UserString.pyRZ~R
cCs|j|jjS(N(RRttitle(R((s//opt/alt/python27/lib64/python2.7/UserString.pyR[R
cGs|j|jj|S(N(RRt	translate(RR*((s//opt/alt/python27/lib64/python2.7/UserString.pyR\scCs|j|jjS(N(RRtupper(R((s//opt/alt/python27/lib64/python2.7/UserString.pyR]R
cCs|j|jj|S(N(RRtzfill(RR.((s//opt/alt/python27/lib64/python2.7/UserString.pyR^R
N(>t__name__t
__module__RR	RRRRRRRRRR R$R&R'R)t__rmul__R+R,R-tsystmaxintR/tNoneR1R4R5R7R9RR:R;R<R=R>R?R@RARBRCRDRERFRHRJRNRORPRQRRRSRTRURWRYRZR[R\R]R^(((s//opt/alt/python27/lib64/python2.7/UserString.pyR
sr																																						cBsheZdZddZdZdZdZdZdZ	dZ
dZd	Zd
Z
RS(smutable string objects

    Python strings are immutable objects.  This has the advantage, that
    strings may be used as dictionary keys.  If this property isn't needed
    and you insist on changing string values in place instead, you may cheat
    and use MutableString.

    But the purpose of this class is an educational one: to prevent
    people from inventing their own mutable string class derived
    from UserString and than forget thereby to remove (override) the
    __hash__ method inherited from UserString.  This would lead to
    errors that would be very hard to track down.

    A faster and better solution is to rewrite your program using lists.R
cCs-ddlm}|ddd||_dS(Ni(twarnpy3ksAthe class UserString.MutableString has been removed in Python 3.0t
stackleveli(twarningsReR(RRRe((s//opt/alt/python27/lib64/python2.7/UserString.pyRs	cCs\t|trt|tr*|j}nt|tsHt|}n|jt|j\}}}|dkr|d|d}}|ddd}n|dkrtdnt	||}|j| ||j||_no|dkr|t|j7}n|dks,|t|jkr5t
n|j| ||j|d|_dS(Niis"invalid step in slicing assignmenti(RtsliceRRRRtindicesRt	TypeErrortmint
IndexError(RRR0R"tstoptstep((s//opt/alt/python27/lib64/python2.7/UserString.pyt__setitem__s$!"!	cCst|tr|jt|j\}}}|dkrT|d|d}}n|dkrltdnt||}|j| |j||_nk|dkr|t|j7}n|dks|t|jkrtn|j| |j|d|_dS(Niis invalid step in slicing deletioni(RRhRiRRRjRkRl(RRR"RmRn((s//opt/alt/python27/lib64/python2.7/UserString.pyt__delitem__s!!	cCst|d}t|d}t|trR|j| |j|j||_nVt|tr|j| ||j||_n%|j| t||j||_dS(Ni(R!RRRRR(RR"R#R0((s//opt/alt/python27/lib64/python2.7/UserString.pyt__setslice__s%"cCs=t|d}t|d}|j| |j||_dS(Ni(R!R(RR"R#((s//opt/alt/python27/lib64/python2.7/UserString.pyt__delslice__scCs
t|jS(N(RR(R((s//opt/alt/python27/lib64/python2.7/UserString.pyt	immutablescCs^t|tr$|j|j7_n6t|trE|j|7_n|jt|7_|S(N(RRRRR(RR%((s//opt/alt/python27/lib64/python2.7/UserString.pyt__iadd__scCs|j|9_|S(N(R(RR(((s//opt/alt/python27/lib64/python2.7/UserString.pyt__imul__scCs||||+dS(N((RRtvalue((s//opt/alt/python27/lib64/python2.7/UserString.pytinsertsN(R_R`t__doc__RRdRRoRpRqRrRsRtRuRw(((s//opt/alt/python27/lib64/python2.7/UserString.pyRs							t__main__is-q(ttest_supports
test.test_(RxRbtcollectionst__all__tSequenceRtMutableSequenceRR_tostpathRStargvt
called_in_dirt	called_astsplitexttpyttestRztverboset
__import__RE(((s//opt/alt/python27/lib64/python2.7/UserString.pyt<module>sxW