1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
à6hc@s5ddlZddlZyddlZWnek
rGddlZnXddlmZmZmZddl    m
Z
m Z ddl Z e dƒZddlZdadaejƒadaejƒad„Zd„Zd    „Zd
„Zd „Zd „Zd „Zd„Zd„Zd„ZdZ d„Z!dS(iÿÿÿÿN(t
CommFuncExtCommFunctmylog(t CommonDefineterrorsConfig.DBConfigii˜•"cCs"tjƒtd7atjƒtS(Ni(tAdoExceptionCounterLocktacquiretADOExceptionCnttrelease(((s .\\ServersRoute\MangoDBCommon.pytaddADOExceptionCounts
 
 
cCstS(N(R(((s .\\ServersRoute\MangoDBCommon.pytgetADOExceptionCount%scCs@t|tƒr<tjr%tj|ƒStjtj|ƒdS|S(Ni(t
isinstancetunicodetDBConfigtbase64t    b64decodeRtUnicodeToEncodingtencoding(ttext((s .\\ServersRoute\MangoDBCommon.pytfix_outgoingText(s
     cCs@t|tƒr<tjr%tj|ƒStjtj|ƒdS|S(Ni(R tstrR Rt    b64encodeRtEncodingToUnicodeR(R((s .\\ServersRoute\MangoDBCommon.pytfix_incomingText0s
     cCsaxZ|jƒD]L\}}t|tƒr tjtj|ƒ\}}|rY|||<qYq q WdS(N(t    iteritemsR RRRRtENCODING(tdictObjtktvtresultt convertText((s .\\ServersRoute\MangoDBCommon.pyt fix_incoming8s
cCsaxZ|jƒD]L\}}t|tƒr tjtj|ƒ\}}|rY|||<qYq q WdS(N(RR R RRRR(RRRRR((s .\\ServersRoute\MangoDBCommon.pyt fix_outgoing?s
cCs"tjƒtd7atjƒtS(Ni(tSIDErrorCounterLockRt SIDErrorCntR(((s .\\ServersRoute\MangoDBCommon.pytaddSIDErrorCntFs
 
 
cCstS(N(R"(((s .\\ServersRoute\MangoDBCommon.pytgetSIDErrorCntNscCs tj|ƒS(N(tbinasciitcrc32(tdata((s .\\ServersRoute\MangoDBCommon.pytmakeSIDRscCsTtjs tS|tkrtSt|ƒ}||kr9tStjd||fƒtS(NsexpectSID = %s calcSID = %s(R tcheckSIDtTruet    MAGIC_SIDR(RtdebugtFalse(R't    expectSIDtcalcSID((s .\\ServersRoute\MangoDBCommon.pyR)Vs       s    c        CsyÓd}|d|}|jdi|d6dii|d6d6dtƒ}|r]|d}nu|jdi|d6dii|d6d    6dtd
tƒ}|r©|d}n)tjd tjd ƒ}tj|ƒdSWnEtjd tjd ||||tjƒfƒ}tj|ƒnX|S(Nis%s_seqtqueryt_idtupdatetseqs$inctnews$settupsertRs seq failed!sOseq failed, colname = %s, fieldname = %s, feed = %d, increment = %d, error = %s(    tfind_and_modifyR*Rt    formatMsgt ERROR_NO_35Rt ERROR_NO_36t    tracebackt
format_exc(    tdbtcollectionNamet    fieldNametfeedt    incrementRt
collectiont    resultObjtmsg((s .\\ServersRoute\MangoDBCommon.pyR3fs"3 0      1("tsysR%t    threadingt ImportErrortdummy_threadingtCommonRRRtDBCommonRRR:t
__import__R RR"R+tLockR!RRR    R
RRRR R#R$R(R)t    SPLITCHARR3(((s .\\ServersRoute\MangoDBCommon.pyt<module>s6