Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/python/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyc


[XMc@sdZddlZdefdYZdefdYZdd0dYZd	efd
YZdefdYZd
efdYZdefdYZ	defdYZ
defdYZdefdYZdefdYZ
defdYZdefdYZdefdYZdefd YZd!efd"YZd#efd$YZd%Zd&efd'YZd(efd)YZd*d1d+YZd,d2d-YZd.d3d/YZdS(4s
Form-based method objects.

This module contains support for descriptive method signatures that can be used
to format methods.
iNt
FormExceptioncBseZdZdZRS(s/An error occurred calling the form method.
    cOstj||||_dS(N(t	Exceptiont__init__tdescriptions(tselftargstkwargs((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs(t__name__t
__module__t__doc__R(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRst
InputErrorcBseZdZRS(s,
    An error occurred with some input.
    (RRR	(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR
stArgumentcBs\eZdZdZddddddZdZddZdZdZ	dZ
RS(	sBase class for form arguments.icCsa||_||_|dkr*|j}n||_||_||_|sTi}n||_dS(N(tnamet	allowNonetNonetdefaultDefaulttdefaultt	shortDesctlongDescthints(RRRRRRR
((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR#s						cKs|jj|dS(N(Rtupdate(RR((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pytaddHints0scCs|jj||S(N(Rtget(RRR((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pytgetHint3scCs|jp|jjS(N(RRt
capitalize(R((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pytgetShortDescription6scCs
|jpdS(Nt(R(R((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pytgetLongDescription9scCs
tddS(s(Convert the value to the correct format.simplement in subclassN(tNotImplementedError(Rtval((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pytcoerce<sN(RRR	RRRRRRRR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs			tStringcBsGeZdZdZdZdZddddddddZdZRS(sA single string.
    Riic		
CsDtj||d|d|d|d|d|||_||_dS(NRRRRR
(RRtmintmax(	RRRRRRR
R R!((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRHs	cCsut|}t||jkr4td|jn|jdkrkt||jkrktd|jnt|S(Ns)Value must be at least %s characters longs(Value must be at most %s characters long(tstrtlenR R
R!R(RRts((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyROs$N(	RRR	RR RR!RR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRAstTextcBseZdZRS(sA long string.
    (RRR	(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR%XstPasswordcBseZdZRS(s2A string which should be obscured when input.
    (RRR	(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR&]stVerifiedPasswordcBseZdZdZRS(sCA string that should be obscured when input and needs verification.cCst|dks&|d|dkr2tdnt|d}t||jkrjtd|jn|jdkrt||jkrtd|jn|S(Niiis%Please enter the same password twice.s)Value must be at least %s characters longs(Value must be at most %s characters long(R#R
R"R R!R(RtvalsR$((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRes&$(RRR	R(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR'bstHiddencBseZdZRS(sSA string which is not displayed.

    The passed default is used as the value.
    (RRR	(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR)pstIntegercBs5eZdZdZddddddZdZRS(sA single integer.
    icCs#tj|||||||dS(N(RR(RRR
RRRR((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR|scCsM|jr|jrdSyt|SWntk
rHtd|nXdS(Ns5%s is not valid, please enter a whole number, e.g. 10(tstripR
Rtintt
ValueErrorR
(RR((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs
N(RRR	RRRR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR*ws
		tIntegerRangecBs)eZddddddZdZRS(ic		
CsD||_||_tj||d|d|d|d|d|dS(NR
RRRR(R R!R*R(	RRR R!R
RRRR((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs		!cCstj||}|jr+|dkr+|S||jkrStd||jfn||jkr{td||jfn|S(Ns/Value %s is too small, it should be at least %ss.Value %s is too large, it should be at most %s(R*RR
RR R
R!(RRtresult((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRsN(RRRRR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR.s	tFloatcBs/eZdZddddddZdZRS(icCs#tj|||||||dS(N(RR(RRR
RRRR((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRscCsM|jr|jrdSyt|SWntk
rHtd|nXdS(NsInvalid float: %s(R+R
RtfloatR-R
(RR((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs
N(RRRRRR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR0s	
tChoicecBs2eZdZggdddddZdZRS(s
    The result of a choice between enumerated types.  The choices should
    be a list of tuples of tag, value, and description.  The tag will be
    the value returned if the user hits "Submit", and the description
    is the bale for the enumerated type.  default is a list of all the
    values (seconds element in choices).  If no defaults are specified,
    initially the first item will be selected.  Only one item can (should)
    be selected at once.
    ic
CsT||_|r.|r.|j|ddntj||||||d|dS(NiiR
(tchoicestappendRR(RRR3RRRRR
((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs	
cCsAx:|jD]\}}}||kr
|Sq
Wtd|dS(NsInvalid Choice: %s(R3R
(RtinIdenttidentRtdesc((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRsN(RRR	RRR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR2s		tFlagscBs2eZdZdddddddZdZRS(s
    The result of a checkbox group or multi-menu.  The flags should be a
    list of tuples of tag, value, and description. The tag will be
    the value returned if the user hits "Submit", and the description
    is the bale for the enumerated type.  default is a list of all the
    values (second elements in flags).  If no defaults are specified,
    initially nothing will be selected.  Several items may be selected at
    once.
    ic	Cs/||_tj||||||d|dS(NR
(tflagsRR(RRR9RRRRR
((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs	cCso|s
gSg}xX|D]P}xG|jD],\}}}||kr'|j|Pq'q'Wtd|qW|S(NsInvalid Flag: %s(R9R4R
(Rt
inFlagKeystoutFlagst	inFlagKeytflagKeytflagValtflagDesc((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs

((N(RRR	RRR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR8s		t
CheckGroupcBseZRS((RR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR@st
RadioGroupcBseZRS((RR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRAstBooleancBseZdZRS(cCs0|s
dSt|j}|dkr,dSdS(	Nitnotntftfalset0i(RCRDRERFRG(R"tlower(RtinValtlInVal((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs(RRR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRBstFilecBs&eZdddddZdZRS(icCs)||_tj||d|||dS(N(R
RRR(RRR
RRR((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs	cCs+|r|jrdS|r|StddS(NsInvalid File(R
RR
(Rtfile((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs
N(RRRRR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRKs	cCs%t|}|dkr!tn|S(Ni(R,R-(tx((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pytpositiveInts	tDatecBs5eZdZdZddddddZdZRS(s#A date -- (year, month, day) tuple.icCs;tj||||||||_|s7d|_ndS(Nii(iii(RRR
R(RRR
RRRR((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRs	cCst|dkr|jrdSytt|\}}}Wntk
rWtdnX||fdkrtj|std|q|||fSnytj	|}Wnt
k
rtdnX||krtdn|||fS(	s(Return tuple of ints (year, month, day).RsInvalid dateiis%d was not a leap year(RRRN(ii(ttupleR
RtmapRNR-R
tcalendartisleaptmdayst
IndexError(RRtyeartmonthtdayRT((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR!s"



N(RRR	RRRR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyROs
	tSubmitcBs5eZdZdgddddddZdZRS(	s0Submit button or a reasonable facsimile thereof.RYtsubmitsSubmit formicCs>tj||d|d|d|d|||_||_dS(NR3RRR(R2RR
treset(RRR3R[RRR
R((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR;s
	cCs(|jr|rdStj||SdS(N(R
RR2R(Rtvalue((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRBs(sSubmitRZsSubmit formN(RRR	RRR(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRY8stPresentationHintcBseZdZRS(s(
    A hint to a particular system.
    (RRR	(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR]IstMethodSignaturecBs&eZdZdZedZRS(cGs
||_dS(s	
        N(tmethodSignature(RtsigList((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRQscCs+x$|jD]}|j|kr
|Sq
WdS(N(R_R(RRta((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pytgetArgumentVscCst|||S(N(t
FormMethod(RtcallablettakesRequest((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pytmethod[s(RRRRbtFalseRf(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyR^Os		RccBs,eZdZedZdZdZRS(s#A callable object with a signature.cCs||_||_||_dS(N(t	signatureRdRe(RRhRdRe((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRbs		cCst|jjS(N(RPRhR_(R((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pytgetArgsgscOs|j||S(N(Rd(RRtkw((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pytcalljs(RRR	RgRRiRk(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyRc_s	(((((R	RRRRR
RRR%R&R'R)R*R.R0R2R8R@RARBRKRNRORYR]R^Rc(((s=/usr/lib/python2.7/dist-packages/twisted/python/formmethod.pyt<module>s0$		#