mň %U˛Ic@s dZdkZdkZdkZd„Zd„Zd„Zd„Zd„Zd„Z dd„Z d „Z d „Z d „Zd efd „ƒYZd„Zdefd„ƒYZd„Zd„Zd„Zd„Zd„Zeƒd„Zedjo eƒndS(s@ Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** In earlier versions of Python (up to 1.5a3), scripts or modules that needed to use site-specific modules would place ``import site'' somewhere near the top of their code. Because of the automatic import, this is no longer necessary (but code that does it still works). This will append site-specific paths to the module search path. On Unix, it starts with sys.prefix and sys.exec_prefix (if different) and appends lib/python/site-packages as well as lib/site-python. On other platforms (mainly Mac and Windows), it uses just sys.prefix (and sys.exec_prefix, if different, but this is unlikely). The resulting directories, if they exist, are appended to sys.path, and also inspected for path configuration files. A path configuration file is a file whose name has the form .pth; its contents are additional directories (one per line) to be added to sys.path. Non-existing directories (or non-directories) are never added to sys.path; no directory is added to sys.path more than once. Blank lines and lines beginning with '#' are skipped. Lines starting with 'import' are executed. For example, suppose sys.prefix and sys.exec_prefix are set to /usr/local and there is a directory /usr/local/lib/python1.5/site-packages with three subdirectories, foo, bar and spam, and two path configuration files, foo.pth and bar.pth. Assume foo.pth contains the following: # foo package configuration foo bar bletch and bar.pth contains: # bar package configuration bar Then the following directories are added to sys.path, in this order: /usr/local/lib/python1.5/site-packages/bar /usr/local/lib/python1.5/site-packages/foo Note that bletch is omitted because it doesn't exist; bar precedes foo because bar.pth comes alphabetically before foo.pth; and spam is omitted because it is not mentioned in either path configuration file. After these path manipulations, an attempt is made to import a module named sitecustomize, which can perform arbitrary additional site-specific customizations. If this import fails with an ImportError exception, it is silently ignored. NcGs4tiitii|Œƒ}|tii|ƒfS(N(tostpathtabspathtjointpathstdirtnormcase(RR((t!/data/zmath/lib/python2.4/site.pytmakepathAscCsSxLtiiƒD];}ytii|iƒ|_Wqtj o qqXqWdS(s6Set all module' __file__ attribute to an absolute pathN( tsystmodulestvaluestmRRRt__file__tAttributeError(R ((Rt abs__file__EscCsng}tƒ}xNtiD]C}t|ƒ\}}||jo|i|ƒ|i |ƒqqW|ti(|S(sK Remove duplicate entries from sys.path along with making them absoluteN( tLtsett known_pathsR RRRtdircasetappendtadd(RRRR((RtremoveduppathsMs     cCs_dkl}d|ƒtif}tiitiitidƒ|ƒ}tii |ƒdS(sbAppend ./build/lib. in case we're running in the build dir (especially for Guido :-)(s get_platformsbuild/lib.%s-%.3si˙˙˙˙N( tdistutils.utilt get_platformR tversiontsRRRtdirnameR(RR((Rt addbuilddiras  (cCsttƒ}xdtiD]Y}y:tii|ƒo#t|ƒ\}}|i |ƒnWqt j o qqXqW|S(sDReturn a set containing all existing directory entries from sys.pathN( RtdR RRRtisdirRRRt TypeError(RRR((Rt_init_pathinfois   c Bs6|djoeƒd}nd}eii||ƒ}ye |dƒ}Wne j o dSnXz­xŚ|D]ž}|idƒoqpn|idƒo|dUqpn|iƒ}e||ƒ\}}||jo4eii|ƒo!eii|ƒ|i|ƒqpqpWWd|iƒX|o d}n|S(soAdd a new path to known_paths by combining sitedir and 'name' or execute sitedir if it starts with 'import'iitrUNt#timport(RtNoneR tresetRRRtsitedirtnametfullnametopentftIOErrortlinet startswithtrstripRRRtexistsR RRtclose( R&R'RR%R*RR(R,R((Rt addpackageus8       cCsä|djotƒ}d}nd}t|ƒ\}}||jotii |ƒnyt i |ƒ}Wnt i j o dSnX|iƒx9|D]1}|it idƒot|||ƒqšqšW|o d}n|S(sTAdd 'sitedir' argument to sys.path if missing and handle .pth files in 'sitedir'iiNtpth(RR$R R%RR&t sitedircaseR RRRtlistdirtnamesterrortsortR'tendswithtextsepR1(R&RR%R'R5R3((Rt addsitedir”s(       cCs•tig}titijo|itiƒnx[|D]S}|oFtidjotii|ddƒg}nqti djoBtii|ddti d dƒtii|dd ƒg}n|tii|ddƒg}tid jo^d |joMti i d ƒ}|o0|itii|d dti d dƒƒqPqTnx6|D]*}tii|ƒot||ƒq[q[Wq:q:WdS(s8Add site-packages (and possibly site-python) to sys.pathtos2emxtriscostLibs site-packagest/tlibtpythonis site-pythontdarwinsPython.frameworktHOMEtLibrarytPythonN(sos2emxsriscos(R tprefixtprefixest exec_prefixRtplatformRRRtsitedirstsepRtenvirontgetthomeR&RR:RR$(RR&RFRIRERM((RtaddsitepackagesŤs:  %  cCsqtiitiddƒ}tididƒ}|do|i |ƒn ||dtZdZdZffd„Zd„Zd„Zd„ZRS(sninteractive prompt objects for printing the license text, a list of contributors and the copyright notice.icCs1||_||_||_||_d|_ dS(N( R'tselft_Printer__nametdatat_Printer__datatfilest_Printer__filestdirst_Printer__dirsR$t_Printer__lines(R[R'R]R_Ra((Rt__init__ôs     cCsÝ|iodSnd}x†|iD]{}xf|iD][}ti i ||ƒ}y*t |dƒ}|i ƒ}|iƒPWq2tj oq2Xq2W|oPq"q"W|p |i}n|idƒ|_t|iƒ|_dS(NR!s (R[RcR$R]RbRR`tfilenameRRRtfiletfptreadR0R+R^RRtlent_Printer__linecnt(R[RgR]ReR((Rt__setupűs*        cCsM|iƒt|iƒ|ijodi|iƒSnd|ifdSdS(Ns s!Type %s() to see the full %s texti(R[t_Printer__setupRiRctMAXLINESRR\(R[((Rt__repr__s cCsÇ|iƒd}d}xŞy1x*t|||iƒD]}|i|GHq3WWntj oPqX||i7}d}x5|djo't |ƒ}|djo d}qwqwW|djoPqqWdS(Ns0Hit Return for more, or q (and Return) to quit: iittq(RoRp( R[RltprompttlinenotrangeRmtiRct IndexErrorR$tkeyt raw_input(R[RtRrRvRq((Rt__call__s(      (t__name__t __module__t__doc__RmRdRlRnRx(((RRZîs   cCs­tdtiƒt_tid djotddƒt_ntddƒt_tiiti ƒ}tddti d d gtii |ti ƒ|tigƒt_d S( s,Set 'copyright' and 'credits' in __builtin__t copyrightitjavatcreditss?Jython is maintained by the Jython developers (www.jython.org).sž Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information.tlicenses+See http://www.python.org/%.3s/license.htmls LICENSE.txttLICENSEN(RZR R|RWRHR~RRRR thereRRtpardirtcurdirR(R((Rt setcopyright+s  t_HelpercBs tZdZd„Zd„ZRS(sYDefine the built-in 'help'. This is a wrapper around pydoc.help (with a twist). cCsdS(NsHType help() for interactive help, or help(object) for help about object.((R[((RRnCscOsdk}|i||ŽS(N(tpydocthelptargstkwds(R[RˆR‰R†((RRxFs (RyRzR{RnRx(((RR…=s  cCstƒt_dS(N(R…RWR‡(((Rt sethelperJscCsžtidjoŠdk}dk}|iƒd}|idƒoTy|i|ƒWq–tj o0dk }|i |i |