cehua_ZWJ
2019-01-30 6afaa4408f4e09e3e95dbd92f0d1cd5a1fb2942b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
ŒôXc@sKdZddlZddlZddlZddlZddlZd„ZedƒedƒddlZddlZddl    Z    ddl
Z
ddl Z e j dddƒZ d    d
d „Zd „Zd „Zdfd„ƒYZee ƒZd„ZedkrGeejƒdkr:eejdƒZeeƒn
edƒndS(sVersion = 2011-07-11 18:00iÿÿÿÿNcCs”d}x‡tjtjƒƒD]p}tjj|ƒ s|jƒ|krMqn|}tjƒd|}|tjkr|qntjj|ƒqWdS(Nts\(tostlistdirtgetcwdtpathtisdirtlowertsystappend(t    importDirt tmpImportDirtdirNametcurPath((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pyt
ImportFile,s%tpiltdict4inis
config.initformats%s=%siiÿcCstjt||dƒƒS(Ni(trandomtchoicetrange(tmintmax((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pyt GetRGBColorFscCs@t|d|dƒt|d|dƒt|d|dƒfS(Niiiiii(R(trgbList((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pytGetColorIscGs    |GHdS(N((targs((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pytLogNstCodePiccBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z    RS(icCs=|j|_|j|_|j|_|j|_i|_dS(N(t
backgroundttextt    confusiontoutputtfontDict(tselftconfig((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pyt__init__Ts
    cCs©|jjdkr!|jƒ}nM|jjdkrVtd|jjƒ|jƒ}ntd|jjƒdS|j|ƒ\}}}|j||ƒ|j|||ƒS(Niis background.type:%s, not realizedsbackground.type:%s, not defined(Rttypet CreateBackImgRtFillTextt AddConfusiontOutPut(R!timaget    colorListtcontenttvalue((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pyt CreateCodePic]sc Cs|jj|jj}|jjdkr>|jjg|}nÊ|jjdkrµ|jjr‡gt|ƒD]}tj|ƒ^qi}qgt|ƒD]}t    |jj
ƒ^q”}nS|jjdkr|jjrìtj|ƒg|}qt    |jj
ƒg|}nt j |ƒ}|jj rxÛt|jjƒD]Ä}tjd|jjƒ}tjd|jjƒ}tjd|jjƒ}    tjd|jjƒ}
tjt|jjd|jjdƒƒ} |j ||    f||
fgt||ƒd| ƒq6Wn|jjr}xmt|jjƒD]V}tjd|jjƒ}tjd|jjƒ}    |j||    ft||ƒƒq WndS(Niiiitwidth(Rt    linecountt
pointcountt    colortypet defaultcolortrandomfontcolorRRRRt randomcolort    ImageDrawtDrawtlinetrandintRR.theighttsizettupletpoint( R!R)R*tconfusionCounttcolortitdrawtx1tx2ty1ty2R:((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pyR'ts2 +.  ,9 c
Cs~|jjdkrtj}nN|jjdkr9|}n3|jjdkrT|}ntd|jjƒtS|jj}|jj}tj    j
|ƒr¸tj    j |d||fƒ}netj    j tj ƒ|ƒ}tj    j |ƒsõtj|ƒntj    j tj ƒ|d||fƒ}tj    j|ƒr3tS|jtjƒ|jj}    |j|    ƒ}|j|ƒtjd7_tS(Niiis(output.filenametype.type:%s, not defineds%s.%s(Rt filenametypeRtcountRtFalsetfiletypetoutpathRRtisabstjoinRRtmkdirtexiststfiltert ImageFiltertBLURtcroptsavetTrue(
R!R)R+R,tnametextRtfilePathtsavePathtbox((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pyR(žs0           "(  cCs«|jj}|jj}|jjdkr?t|jjƒ}nM|jjdkrft|jjƒ}n&td|jjƒt|jjƒ}t    j
d||f|ƒ}|S(Niis#background.colortype:%s not definedtRGB( RR.R9R1R;R2RR4RtImagetnew(R!R.R9tbgcolorR)((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pyR%Ås  cCs(|jƒ}|jƒ}g}tj|ƒ}|j|jƒ\}}|jjdkrst|ƒ|jjg}nŽ|jjdkr¹gtt|ƒƒD]}t    |jj
ƒ^q˜}nH|jjdkrít|ƒt    |jj
ƒg}nt d|jjƒ|jj dkr,t|ƒ|j g}    n”|jj dkrugtt|ƒƒD]}tj|jjƒ^qQ}    nK|jj dkr¬t|ƒtj|jjƒg}    nt d|jj ƒxÞt|ƒD]Ð\}
} tjt|jjd|jjdƒƒ|
|jj} tjt|jjd|jjdƒƒ} tj|jjƒ}d}|jj|    |
ƒr¥|j|    |
j|ƒr¥|j|    |
|}q¥n|s]|    |
d}tjjtjƒ|ƒ}tjj|ƒrï|}n3tjjdƒ}|r"tjj|d    |ƒ}ntj ||ƒ}i|j|    |
<||j|    |
|<n||
}|j|jj!| |jj"| f| d
|d |ƒqÍW~|j#ƒ}|j#ƒ}d}x–td|j$j%ƒD]}||jj&7}xftd|j$j'ƒD]O}||}d|ko1|j$j'knr|||f|||f<qqWqØW|j#ƒ}|j#ƒ}d}x–td|j$j'ƒD]}||jj(7}xftd|j$j%ƒD]O}||}d|koè|j$j%knr»|||f|||f<q»q»WqW|d j|ƒ|fS( Niiistext.colortype:%s not definedstext.fonttype:%s not definedis.ttftWINDIRtfontstfonttfillR()tcopyR5R6t
GetContentRR1tlenR2RRR4Rtfonttypet defaultfontRRt
randomfontt    enumeratetvoffsetthspacetfontsizetNoneR thas_keyRRRKRtisfiletenvirontgett    ImageFontttruetypetstarthtstartvtloadRR9t hdistortionR.t vdistortion(R!R)tnewImaget
newImageExR*R@R+R,R?t fontTypeListtktvthpostvpostfontSizeR_tfilenameRVtfilanametwindirt    fontcolortnewPixtpixtoffsettytxtnewxtnewy((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pyR&Ùsx  4"7%:,    
:  
"%  
"%cCsâg}g}|jdkrR|jrjtjƒ|jkrj|j}tjt|d|dƒƒtjt|d|dƒƒg}tj|jƒ}|dkr·|j r·|j    ƒnt
t |dƒƒ|gt
t |dƒƒdg}dj |d ƒ}idd6dd6}x;|j ƒD]-\}    }
|    |kr#|j|    |
ƒ} q#q#Wt| ƒ} || fS|jr‰|tddƒ}n|jrÑ|gttd    ƒtd
ƒdƒD]} t| ƒ^qµ}n|jr|gttd ƒtd ƒdƒD]} t| ƒ^qý}nx•t|jƒD]"} |jt tj|ƒƒƒq)Wn_|jd krgt|jƒD]#} t tj|d| ƒƒ^qq}ntd|jjƒdj |ƒ} |jrØ| jƒ} n|| fS(Niis-s=Riÿÿÿÿs+i
tAtZtatzischr%sstext.createtype:%s not defined(t
createtypetexprRtexprratetexprelemRRt exproperatortexprallownegsubtsorttlisttstrRKtitemstreplacetevaltdigitaltsuppertordtchrRtchrcountRRRt ignoresupper(R!RtstrListtretTexttelementtdigittoperatorRt    transDictRzR{ttempR,R?((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pyRb9sD    @ 8
 
        ?    ?#<    (
t__name__t
__module__RFR#R-R'R(R%R&Rb(((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pyRQs                *    '        `cCsdtjƒ}d}x8||krLtjƒrd||fGH|d7}qqWdGtjƒ|GHdS(Nismaking %s/%s ...is
time cost:(ttimetmakerR-(RFtstimeR¦((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pytMakeks  t__main__iii
(t__doc__RtmathRRR©R RZR5RpROt    _dict4initDictIniR"RRRRRªR¬R§RctargvtintRF(((sv.\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\CaptchaImage\VerificationCodePic\VerificationCodePic.pyt<module>s.         
 
0         ÿ