mò p%ÜGc@sðdkZdkZdkZdkZdkZdkZdkZdkZdkZdk Z dk Z dk Z dk Z dk Z dZeid„Zeid„Zde ifd„ƒYZde ifd„ƒYZddddd „Zd deieieieid „Zd ZeoJx=eeeiƒƒD]&Z eii!eie ƒeie s1 spyce -w <-- CGI s; spyce -O filename(s).spy <-- batch process s: spyce -l [-d file ] <-- proxy server s spyce -h | -v s7 -h, -?, --help display this help information s) -v, --version display version s3 -o, --output send output to given file sB -O send outputs of multiple files to *.html s6 -c, --compile compile only; do not execute sI -w, --web cgi mode: emit headers (or use run_spyceCGI.py) s? -q, --query set QUERY_STRING environment variable s1 -l, --listen run in HTTP server mode sD -d, --daemon run as a daemon process with given pidfile s2 --conf [file] Spyce configuration file s7To configure Apache, please refer to: spyceApache.conf s.For more details, refer to the documentation. s http://spyce.sourceforge.net sBSend comments, suggestions and bug reports to . N(RRR(R((Rt showUsages,                    tspyceCmdlineRequestcBs8tZdZd„Zed„Zed„Zd„ZRS(s?CGI/Command-line Spyce request object. (see spyce.spyceRequest)cCs¤tii|ƒ||_t|ƒ|_|ii dƒpdti |idth(R RIRG((Rt sendHeadersms  cCs$|io td‚ng|_dS(Nsheaders already sent(R R?t ExceptionR>(R ((Rt clearHeadersvs cCs$|io td‚n||_dS(Nsheaders already sent(R R?RKt content_typeR@(R RM((RRHys cCs$|io td‚n||_dS(Nsheaders already sent(R R?RKtcodeRA(R RN((Rt setReturnCode|s cCsu|io td‚n|djo|i|ƒn=|ot|d„|iƒ|_n|ii ||fƒdS(Nsheaders already sents Content-TypecCs|\}}||jS(N(R,t_tt2(t.0RQR,RP((Rt„s( R R?RKR,RHtdatatreplacetfilterR>tappend(R R,RTRU((Rt addHeaders  cCs*|odSn|iƒ|iiƒdS(N(tstopFlagR RJRRD(R RY((RRD†s cCs|iƒ|iiƒdS(N(R RJRtunbuffer(R ((RRZŠs ( R1R2R3RRERJRLRHRORXRDRZ(((RR5Ys        s /dev/nullc Csd„}|ƒtidƒtidƒtiƒ|ƒttiƒƒ}|o.t |dƒ}|i d|ƒ|i ƒnt |dƒ}t |dƒ} t |ddƒ}ti|iƒti iƒƒti| iƒtiiƒƒti|iƒtiiƒƒdS( s[Forks current process into a daemon. stdin, stdout, and stderr arguments are file names that are opened and used in place of the standard file descriptors in sys.stdin, sys.stdout, and sys.stderr, which default to /dev/null. Note that stderr is unbuffered, so output may interleave with unexpected order if shares destination with stdout.cCsqy(tiƒdjotidƒnWnBtj o6}tiid|i|i fƒtidƒnXdS(Nisfork failed: (%d) %s i( R.tforktsystexittOSErrortetstderrRterrnotstrerror(R_((Rt forkToChild˜s  t/isw+s%s trsa+N(RcR.tchdirtumasktsetsidtstrR/tpidtpidfiletopentfRREtstdintsitstdouttsoR`tsetdup2tfilenoR\( RnRpR`RkRmRjRoRcRrRq((Rt daemonize’s$    ic! Csàd}d}d}d}d}d} |o|o |g}nœyAt i t i dddddddd d d d g ƒ\}}WnLt ij o=|o|id ƒn|idƒ|idƒdSnXx|D]\}}|d2jotƒdSn|d3jotƒdSn|d4jo d}n|d5jo |}n|d6jo d}n|d7jo d}n|d8jo||d ƒ|id/ƒnJt?||| ƒ}tB|||ƒ} t/iE|| | d0|ƒ} | i>ƒWn tFtGfj o ‚n†tHiItHiJfj o8}|o|id ƒn|itL|ƒd/ƒn7|o|id ƒn|it3iMƒd/ƒnX|o|i>ƒq4q4WWn tGj o|id1ƒnX| S(<s!Command-line and CGI entry point.iish?vco:Owq:ld:p:thelptversiontcompilesoutput=twebsquery=tlistensdaemon=sconf=sContent-Type: text/plain ssyntax: unknown switch used sUse -h option for help. iÿÿÿÿs-vs --versionNs-hs--helps-?s-cs --compileonlys-os--outputs-Os-ws--webs-qs--queryR s-ls--listens-ds--daemons--confs=compile mode (-c) is incompatible with http listen mode (-l) tdaemons"syntax: too many files to process s/syntax: please specify a spyce file to process s.htmlsProcessing: %s twR tfiles tconfigsBreak! (s-vs --version(s-hs--helps-?(s-cs --compileonly(s-os--output(s-O(s-ws--web(s-qs--query(s-ls--listen(s-ds--daemon(s--conf(NtcompileonlyModeR4toutputFilenametdefaultOutputFilenamethttpmodeR{t configFileR8t cgiscripttargstgetoptR\targvtoptsterrorRpRtotaRRtenviront spycePreloadtdefaultConfigFiletspyceWWWtspyceHTTPservertgetConfigModulet configmodtlentmaptglobtglobbedtgRmRWtresulttscriptR.tpathtdirnametdirtbasenameRftoutputtsplitextRDRlRt getServertserverR}R)tisTagCollectiont spyceCompiletreadtTrueRNtcoderefstmodrefst spyce_cachetstgetCodeRERRntrequestR5R`tresponsetspyceFileHandlert SystemExittKeyboardInterrupttspyceExceptiontspyceForbiddent spyceNotFoundR_RitexceptionString(!R8R„RpRnR`RŒR«RNR€R¡R¦R™R¬RƒRR…R–R‚R§RR’R‹R{R_R—RmRŠRR©RœRžRˆR˜((Rt spyceMain¹sæ .                #       * it__main__tcmdR8sBreak!((timpR†R\t tracebackR.tos.pathtstringR•tcopyRR°R)R£RR3RpRRRRR7R5R4RuRnR`RŒR´tABSPATHtrangeR“RštitabspathR1t SPYCE_ENTRYR]R¯R®t print_exc(R°R´R5RR·R†RRR3RºR•R\R£R»R)R¾RR¼R¸RuR.R((Rt? s2Q-#9''k$