m HcEc@sBdklZdklZdkTdkZdkZdkZdkZdk Z dk Z dk Z dk Z dk Z dkZeiddjZdZeZeodeid Znd eid ZdZd d d d gZgZeiD])Zedeijoeednq[ZdZddZdZdfdYZdZ defdYZ!dfdYZ"dZ#dddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7fZ$d8Z%dde&d9de&d:Z'd;Z(d<Z)d=Z*ddd>Z+dS(?(sCommand(sspawn(t*NtPicCs9x2tiD]$\}}}|djotSq q WtS(Ns_d.pyd(timpt get_suffixestextt_tTruetFalse(RR((t1C:\Python24\Lib\site-packages\py2exe\build_exe.pyt_is_debug_builds    spython%d%d_d.dllispython%d%d.dlls.pys.pyos.pycs.pywicCsI|id}d}x-|D]%}ti||}|dg}qW|S(Nt.i(tnametsplittnamestNonetpathRt find_moduletresult(R RRR ((Rtimp_find_module,st,cCs[|djogSnt|do2g}|i|D]}||iq9~Sn|S(NR (tstrRthasattrt_[1]R tseptitemtstrip(RRRR((Rt fancy_split5s  2sO def __load(): import imp, os, sys try: dirname = os.path.dirname(__loader__.archive) except NameError: dirname = sys.prefix path = os.path.join(dirname, '%s') #print "py2exe extension module", __name__, "->", path mod = imp.load_dynamic(__name__, path) ## mod.frozen = 1 __load() del __load tTargetcBs#tZdZdZdZRS(NcKsS|ii||iid}|o&t|tijo|g|_ ndS(Ntmodules( tselft__dict__tupdatetkwtgettmttypettypest StringTypesR(RR R"((Rt__init__SscCst|dd}|o|Snt|dd}|o$tiitii|dSnt|dd}|di ddS(Nt dest_basetscriptiRR i( tgetattrRRR'R(tosRtbasenametsplitextRR (RR(RR'((Rt get_dest_baseYs$cCst|dgt|dg}x^|D]V\}}t|tdjo tdntii |ptd|q)q)WdS(Ntbitmap_resourcesticon_resourcesisResource ID must be an integers%Resource filename '%s' does not exist( R)Rt resourcestr_idt r_filenameR#tDistutilsOptionErrorR*Rtisfile(RR1R2R0((Rtvalidatecs"  (t__name__t __module__R&R-R5(((RRRs  cCs|p|Sng}x|D]}t|tijoth||<}n@t |d|}|i |pt d|nt|}|i |i|qW|S(NRs,This target class requires an attribute '%s'(ttargetstrett target_defR#R$R%Rtdefault_attributettargetR)tdthas_keyR3R5tappend(R8R;R<R:R9R=((Rt FixupTargetsls  tpy2execBstZdZdLdMdNdOdPdQdRdSdTdUdVdWdXg Zddd dgZd%Zd&Zd'Zd(Z d)Z d*Z d+Z d,Z d-Zd.Zd/Zd0Zd1Zd2Zd3Zd4Zd5Zd6Zd7Zd8Zd9Zd:d;Zd<Zd=Zd>Zhd?Zd@Z ddAZ!dBZ"dCZ#dDZ$dEZ%dFZ&dGZ'dHZ(dIZ)dJdJdKZ*RS(YNts optimize=tOs`optimization level: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]s dist-dir=R=s?directory to put final built distributions in (default is dist)s excludes=tes*comma-separated list of modules to excludes dll-excludes=s'comma-separated list of DLLs to excludesignores=s?comma-separated list of modules to ignore if they are not founds includes=tis*comma-separated list of modules to includes packages=tps+comma-separated list of packages to includet compressedtcscreate a compressed zipfiletxreftxs(create and show a module cross references bundle-files=tbsLbundle dlls in the zipfile or the exe. Valid levels are 1, 2, or 3 (default)s skip-archivesVdo not place Python bytecode files in an archive, put them directly in the file systemtasciitas1do not automatically include encodings and codecsscustom-boot-script=sDPython file that will be run when setting up the runtime environmentcCsd|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_dS(Nii(RRIRGt unbufferedtoptimizeRtincludestexcludestignorestpackagestdist_dirt dll_excludesttypelibst bundle_filest skip_archiveRLtcustom_boot_script(R((Rtinitialize_optionss              cCst|i|_t|i|_t|i|_t|i|_t|i|_|idjp|idjotd|int o$|idjotd|in|i o;|i o tdn|i i djo tdqnx5|iD]*}||ijo|ii|qqWt|i|_|idd g}t|iD]}||iql~|_dS( Niis'bundle-files must be 1, 2, or 3, not %ss*bundle-files %d not yet supported on win64s$can't compress when skipping archives,zipfile cannot be None when skipping archivetbdistRT(sdist_dirsdist_dir(tintRRORRQRPRRRWR3tis_win64RXRGt distributiontzipfileRR"tremoveRStset_undefined_optionsRRURJtlower(RR"RRJ((Rtfinalize_optionss,      cCs|id}|iti}|idj otii d|in|i dj otii d|i nz|i Wd|t_XdS(Ntbuildi( Rtreinitialize_commandRdtruntsysRt sys_old_patht build_platlibRtinsertt build_libt_run(RRhRd((RRfs  cs|i|i|i|i}g}x/|i|i|i D]} |i | i qEWg}|i|iD]} || iqt~} |i} x!|iD]}| i|iqW|iodGHdkl}tii|idd} || t| |i}d|t!|ifGH| i"d| |i#i$dnt%dk'}d}||_%dGH|i)| | |d GH|i*| \} }}|i.o| i/nd GH|i0|}|i2| i | ||g}|D]3}tii4|i5|i6jo ||qq~}d GH|i7| |||i8| | i9od GH| i9GHn|i:oWHd GHdGHdGHHdGHdGHHx8|i:D])}dGtii4|GdG|i<GHqWndS(Ns*** generate typelib stubs ***(smkpathtwin32comtgen_pys)collected %d stubs from %d type librariesswin32com.gen_pycsNy|||}Wn1tj o%}td||ii |fnX|S(Ns compiling '%s' failed %s: %s( t orig_compiletsourcetfilenametargsRt ExceptiontdetailstDistutilsErrort __class__R6(RpRqRrRtR(Ro(Rt my_compiles !s&*** searching for required modules ***s*** parsing results ***s*** finding dlls needed ***s*** create binaries ***s*The following modules appear to be missings*** binary dependencies ***sDYour executable(s) also depend on these dlls which are not included,s+you may or may not need to distribute them.sAMake sure you have the license if you distribute any of them, andsGmake sure you don't distribute files belonging to the operating system.s t-(=Rtcreate_directoriest plat_preparetfixup_distributionR^tdisttrequired_modulest com_servertservicetctypes_com_serverR<textendRRtwindowstconsoleR(trequired_filestcreate_modulefindertmftisapitft load_fileRVtdistutils.dir_utiltmkpathR*Rtjointtemp_dirt genpy_temptcollect_win32com_genpyt num_stubstlent load_packageRSR?tcompileRot __builtin__Rwtfind_needed_modulestparse_mf_resultstpy_filest extensionstbuiltinsRIt create_xreft find_dllstdllst plat_finalizeRR+RbRUtcreate_binariestfix_badmodulest any_missingt other_dependstfnmR(RR|RRR}RwRRRoRRRRR<RRRRRR((RoRRlsn    .          G    cCs7dkl}dkl}|dd|d|iS(N(sReplacePackage(s ModuleFindert_xmlplustxmlRQ(t modulefindertReplacePackaget py2exe.mft ModuleFinderRRQ(RRR((RR6s   cCs^hdd<dd<dd<dd<d d <d d <d d<dd<dd<dd<dd<dd<dd<dd<dd<dd <d!d"<d#d$<d%d&<d'd(<d)d*<}|i}x|iD]}}||ijo||=qn|i|d}|dj o:|||jo%||h|d+|}|i i!|qWx,|i"D]!}|i?||i@|}q Wx|iAD]}tB|dtCo/|iD||iE|}|ii!|ntB|dtCo/|iD||iF|}|ii!|qOqOWxB|iGD]7}|iD||iH|dd}|ii!|qW|idjotiI|na|iJdjp |iKoFtL|diM}tL|d} |iJdjosdtP|fGH| iQdtLtii|iRtPdiM}| iQtTiUdtV|| iQ|n|iKotWiXdd} | ofdt$odpd |fGH| iQd!| iM}| iQtTiUdtV|| iQ|qn| iQ|ndS("Ns!*** byte compile python files ***t target_dirROtforceitverboseRtbase_dirtfiless*** copy isapi support DLL ***sPyISAPI_loader_d.dllsPyISAPI_loader.dllRs.dllRs*** copy data files ***t install_datat create_exet create_dllt boot_scriptRitrbtwbisAdding %s to %ss REtzlibsAdding zlib%s.pyd to %st_dRBs (ZRR^R|t byte_compileRRRORRRRtconsole_exe_filestwindows_exe_filestservice_exe_filestcomserver_filesRRRRR_Rttempfiletmkstemptfdt archive_nameR*tcloseRRRR+tmake_lib_archivetarcnameR?RR<tis_debug_buildtsrc_namet__path__RR,R(t script_baseRRRthas_data_filesReRRTt install_dirtensure_finalizedRfRt get_outputsRtbuild_executabletget_console_templateRtget_windows_templateRt build_servicetget_service_templatet build_isapitget_isapi_templateR~R)Rtbuild_comservertget_comexe_templatetget_comdll_templateRtget_ctypes_comdll_templatetunlinkRWRGtopentreadtarcbytestarcfileRtwriteRtbyteststructtpackRRRt zlib_file(RRRRR|RRRRRRRRRR<RRRR((RRs                 %              '   cCstodpdS(Ns run_d.exesrun.exe(R(R((RRascCstodpdS(Ns run_w_d.exes run_w.exe(R(R((RRdscCstodpdS(Ns run_d.exesrun.exe(R(R((RR gscCstodpdS(Nsrun_isapi_d.dlls run_isapi.dll(R(R((RR jscCstodpdS(Ns run_w_d.exes run_w.exe(R(R((RR mscCstodpdS(Ns run_dll_d.dlls run_dll.dll(R(R((RRpscCstodpdS(Nsrun_ctypes_dll_d.dllsrun_ctypes_dll.dll(R(R((RRsscCs|i}t|id|_t|id|_t|id|_t|id|_t|id|_t|i d|_ t i }xL|i|i|i|i|i D]%}|itii|iqWt|djo,tdg}|D] }||q~n|o_|i}tii|otd|ntii|i||_|i|in |i|_dS(NRR(is+all targets must use the same directory: %ss"exe directory must be relative: %s(RR^R|R@R~RRRRRtsetstSettpathsR<taddR*RRR-RR3RRFtpopRtisabsRRTRR(RRR|R<RRFR((RR{vs(  &#, cCs7tidi}tiitii|d|dS(Nspy2exe.build_exetboot_s.py( RgRRtthisfileR*RRRt boot_type(RR"R!((Rtget_boot_scriptst com_serverscCs:hd|i<}|i|}|i|||||S(Ntcom_module_names( R<RtvarsRR#RtbootRttemplateR(RR<R(RRR&R'((RR scCst|ti|}x;|iiD]!\}}t |doPq'q'Wt df}t |do |i }n|i |i|i|fS(Nt _svc_name_sNo services in modulet _svc_deps_(t __import__t module_nameRgRRRtitemsR tklassRt RuntimeErrortdepsR*R6R)t_svc_display_name_(RR,R R.R0R((Rtget_service_namess      cCsxt|dd}|dddgjo tdnhd|i<d|<}|id}|i |||||S(Nt cmdline_styleRAtpywin32tcustomscmdline_handler invalidtservice_module_namesR( R)R<R3R/RR&RR#R'RR(R(RR<R(RR&R'R3((RRs cCsMtiitii|id}hd|<}|i |||d|S(Nitisapi_module_name( R*RR,R+R<R(t target_moduleR&RRR(RR(RR<R(RR&R8((RR s%c+Csmdkl}l}tii|d}(|i })tii |i |)|(} ttii|)itid}|it|i d} dti|}| o|| ti7}n|tii|7}tii tiit|}"|i}'t|_|i|"| dd|'|_ti | t!i"t!i#Byt$| d}#|#i&Wn$t'j o}d| |fGHnX|i)d}t+t,|d i-tii.|d }|g}|i1d jo|i2t+d d d nx=|i4D]/\}} |i2t+d|| f|d qW|i7oHt+t,|i7d i-dtii.|i7d }|i2|n|oBt+t$|d i-dtii|d }|i2|nt:i;|}|i=i>djotii| }nt@iAdd|iB|iCt||d}||d}|iFdt||iGp+|tH| |ddt|i1djo{|i=i>djohtii |iItJ}t$|di-}&dtJ| fGH|tH| |&tHtJiMdtNn|iOov|i1d jof|i=i>djoStPiQdd}|o5d| GH|i-} |tH| | ddtNqqntT|dg}xW|D]O\} }*t$|*di-}|iGp$|tH| |dtY| tNqqWtT|dg} x>| D]6\}%}!|iGp |tH| tH|!|%qqWxmtT|dgD]Y\}}$}|iGp@t`|taotH|}n|tH| |||$tNqfqfWtT|d d}|dj o5t$|di-}|tH| |d!dtNn|ic|| |i=i>djo/t$|di-}t$| die|n| S("N(s add_resourcesadd_iconis..Risa+bs)WARNING: File %s could not be opened - %stcommontUtexecis/import zipextimporter; zipextimporter.install()ss%s=%r s tiiiii4Vxttsadd script resource, %d bytesu PYTHONSCRIPTiRsAdding %s as resource to %sRs!Adding zlib.pyd as resource to %suZLIB.PYDR.iR/tother_resourcesttypelibuTYPELIB(ft py2exe_utilt add_resourcetadd_iconR*RR,R(RR<R-texe_baseRRRTtexe_pathRtnormpathR Rt parent_levelsRtlib_leaftrelative_arcnameR+RRRRRt old_forceRRtchmodtstattS_IREADtS_IWRITERRRtIOErrortwhyR#R'RtfileRRt boot_codet code_objectsRWR?R&R-tvar_nametvar_valRYt code_objectR(tmarshaltdumpst code_bytesR^R_RRRRORNtsit script_bytestannounceRtunicodeRRtdll_pathRtupperRRGRRRt zlib_bytesR)R.tbmp_idt bmp_filenametbmp_datat RT_BITMAPR/tico_idt ico_filenametres_typetres_idtdatat isinstanceRR@tadd_versioninfotzip_dataR(+RR<R(RR(R&R[RRRcR/RERURHR`RgRVR'RYRZRSRTR@RIRlR.R^RGRCRBRRiRPRaRfRRRhReRRJRRDRb((RRs (!      '   #-    (  $ $  c s2|iid}|d}|djodSndkl}l} l }||d|dd|dd|dd|d d |d d t i i |d |dd|dp|}y|i}Wn*|j o}|id|dSnXdkl} | t||| dtdS(Ncst|t||dS(N(R)R<R tmdR(R Rm(R<(RR!]stversion(sVersions RT_VERSIONs VersionErrortfile_descriptiont descriptiontcommentst company_nametlegal_copyrightt copyrighttlegal_trademarkst trademarkstoriginal_filenamet product_nameR tproduct_versions'Version Info will not be included: %s(s add_resourcei(RR^tmetadataR!RnRtpy2exe.resources.VersionInfotVersiont RT_VERSIONt VersionErrorR*RR+REtresource_bytesRtdetailtwarnRARBR]R( RR<RER|R!RR~RRnRBR}((R<RRkZs*          c Cs_dkl} l}dkl}|p|iii pd}|i od||fGHn|i odSnt i|}t i|titiByt|d}|iWn$tj o}d||fGHnX| }|id|t} x<|iD].\} } |t|| || | t } qWt i!||ti"|ti#fdS(N(s StringTables RT_STRING(s add_resourceRAs#setting sys.winver for '%s' to '%s'sa+bs)WARNING: File %s could not be opened - %si($tpy2exe.resources.StringTablest StringTablet RT_STRINGRARBt new_winverRR^RzR Rtdll_nameRR*RLtstRKRMRNRRRRORPtst add_stringRtdeletetbinarytidRiR]RtutimetST_ATIMEtST_MTIME( RRRRRRPRRRBRiRRR((RR|s,      cCs-dk}|i} |i}tiiti }ti d} di || || g}|ddi |}ti} |iio| i|in|iio| i|in|iio| i|inxh|iiD]Z}t|dto| i|i nt|dto| i|i!qqWg}| D](}|tii tiit$|qc~} || }|i'dt(||ti g|\} }}| i-ti x| D]} |i'd| qWx| D]}| i-|q W| ||fS(NtPATHt;RRsResolving binary dependencies:s %s(/RAt get_sysdirtsysdirt get_windirtwindirR*RRRgt executabletexedirtenvirontsyspathRtloadpathtpypathRRt templatesRR^RRRRRRR R~R<R)RR RRttRRtimagesR\t bin_dependsRUtalldllstwarningsRR`R(RRRRURRARRRRRRRRRRR<RR((RRs@         <  %cCsRhddg<ddg<ddg<ddg<ddg<d d d d gscCst|i|iS(N(RRMRRK(RMRK((RRs(s pythoncoms pywintypes(5RRR-R timportsRRtkeysRt import_hookRt tcl_src_dirt tcl_dst_dirRt_tkintertcreatettktcallttcl_dirR*RR RRR\t copy_treet TCL_VERSIONt TK_VERSIONRRRtvaluesRR6RWRRR,RRtsuffixRgtplatformt startswithtendswitht _py_suffixesR?t _c_suffixest create_loadertloaderR/treprtsort(RRRRRRRRRRRRRRRR RRRR((RRsb        6    cCstidjotd|ijodk}|i|ind|ijodk}|i|in|i ||nt dtidS(Ntwin32RRsPlatform %s not yet implemented( RgRRRRRRRRRt copy_w9xpopenRu(RRRRRRR((RRs  cCsd|ijpd|ijo{to(tiitiitid}n%tiitiitid}tii |o|i |qndS(NR*tpopen2sw9xpopen_d.exes w9xpopen.exe( RRRR*RRRRgRtfnametexistsRR(RRRR((RR*s &($cCstii|id|i}|iod|iGHntii |i }t |}|ipt|di|ndSdkl}||i|S(Ns%s.pys)creating python loader for extension '%s'tw(sModule(R*RRRRRR6tpathnameRR+RRtLOADERRpRRRRRtModule(RRRpRRR((RR6s    c/Cs|iid|ip$|iid|iidn|idjo$|iid|iidn|io|iidn|iidt i d jo|id d d d ddddddddddddddddddd d!d"d#d$d%d&d'dd(d)d*d+d,d-d.d/d0d1d2d3d4d5g-7_t d6t od7pd8d9t od:pd8g|_ ntd;t i dS(<NRRRitzipextimportert _memimporterRsos.pathRtALt Audio_macs Carbon.Files Carbon.FoldersCarbon.Folderst EasyDialogstMacOStMailmantSOCKSt SUNAUDIODEVt_dummy_threadingt _emx_linkRt _xmlrpclibtalt bundlebuildertcetcltdbmtdostfcntltgestalttgrptics java.langtmactmacfst macostoolst mkcwprojectsorg.python.coretos2tpolltposixtpwdtreadlinetriscost riscosenviront riscospatht rourl2pathtsgitsgmlopt sunaudiodevttermiostvms_libsw9xpopen%s.exeRRBs msvcr71%s.dllR=sPlatform %s not yet implemented(RRPR?RLRSRWRQRGRRRgRRRRRu(R((RRzFs  .:c Cs~x|D]} |i| qWx|D]} |i| q%W|i|id|i i o|i|idn|i i o|i|idn|i i o|i|idn|i o|i|i nxM|iD]B} | ddjo|i| d ddgq|i| qWxB|iD]7}d}|i|||ijo:|i|}|idjo|ig}q|i}nByt|d g}Wn'tj o|id |q?nXg} x|D]} tii| || x`| D]X} | i| oB|d | t| d id d }|i|ddgqqWqWq?W|S( NR9R$RRis.*RcCs"d|jo|i|ndS(Ns __init__.py(R targR?R(RRR ((Rtvisits isNo package named %sR s\(!RRRRRRt run_scriptRR#R^R~RRRYRPRRSRRtmoduleRRRRt ImportErrorRR*twalkRFRRtreplaceR( RRRRRRRRRRFRRSR((RRsX          (&ic Csodkl}|ip|tii|d||i o t i } n t i } |pVt i|dd| }x-|D]%} |itii|| | qyW|in|Sndkl}tii|} x|D]} tii| } | o)|tii| | d|d|n|tii|| tii| | ddd|d|qWd SdS( N(smkpathRRt compression(s copy_fileRRiR (RRRRXR*RRt zip_filenameRRGR_t ZIP_DEFLATEDR t ZIP_STOREDtZipFiletzRRRRRRtdistutils.file_utilRt destFolderR=R( RR RRRRRRRRR=R R((RRs6       # )(s optimize=RCs`optimization level: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0](s dist-dir=R=s?directory to put final built distributions in (default is dist)(s excludes=RDs*comma-separated list of modules to exclude(s dll-excludes=Ns'comma-separated list of DLLs to exclude(signores=Ns?comma-separated list of modules to ignore if they are not found(s includes=REs*comma-separated list of modules to include(s packages=RFs+comma-separated list of packages to include(s compressedRHscreate a compressed zipfile(sxrefRJs(create and show a module cross reference(s bundle-files=RKsLbundle dlls in the zipfile or the exe. Valid levels are 1, 2, or 3 (default)(s skip-archiveNsVdo not place Python bytecode files in an archive, put them directly in the file system(sasciiRMs1do not automatically include encodings and codecs(scustom-boot-script=NsDPython file that will be run when setting up the runtime environment(+R6R7RpRt user_optionstboolean_optionsRZRcRfRlRRRRyRRRRRRR R R RRR{R#R R2RR RRkRRRRRRRRzRR(((RRA~sP-%   S  ,     {        "     " 3 ?   E KtFileSetcBsStZddZdZdZdZdZdZdZ dZ RS( NcCs<h|_|dj o"x|D]}|i|qWndS(N(Rt_dicttiterableRRR(RRR((RR&s   cCsd|iit|fS(Ns(RRRR(R((Rt__repr__ scCs||i|iRARmRER((RRs0        cCsti|ddS(Ni(R*RKRQ(RQ((Rt_chmodscCsxti|D]|}tii||}tii|o%tii| ot||q|i t |f|i ti |fqW|i ti |fdS(N(R*tlistdirRRRtreal_ftisdirtislinkt_build_cmdtuplet cmdtuplesR?RGR`trmdir(RRMRRI((RRLs'c Csdk}dkl}|ii}|o d|GHn|odSng}t ||x|D]}yG|d|dt i i |d}|i|o ||=nWq_ttfj o&} |o|| d|GHqq_Xq_WdS(sRecursively remove an entire directory tree. Any errors are ignored (apart from being reported to stdout if 'verbose' is true). N(sgrok_environment_errors'removing '%s' (and everything under it)iiserror removing %s: (t distutilsR1tgrok_environment_errortdir_utilt _path_createdRt directoryRRMRLR4R*RRR>ROtOSErrortexc( RSRRRMRORRR4RPRRU((Rtforce_remove_tree s(     (,tdistutils.coretCommandtdistutils.spawnR5tdistutils.errorsRgR*RR$RLRWR_RRRtcalcsizeR]R RRRRdRRRt_triplet C_EXTENSIONRRRRRR@RARRR(R$RRRRGRLRV($R5RR RRRLRRRRGRRRRRR\R(R@R]RLRR_RRgRVRXRR$RARRR$RRdR*RW((Rt? sH  -       C  " ]# c "