)Uc@s#dZddlmZdZdZdZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddlZ ee dsdge _nddl Z ddlZddlZdd lmZmZmZmZe j\ZZZZZed koed kZeZes7e d nddl!Z!ge!jj"d d D]Z#e$e#^qZ\Z%Z&e%dkpe%dkoe&dkse de!jndZ'dZ(ddcdYZ)e)Z*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4e*j5de4de6Z7d Z8e*j5d!e8de6Z9d"Z:d#Z;e*j5d$e;de6Z<d%Z=d&Z>d'Z?id(d)6d(d*6d+d,6d-d.6d/d06d1d26Z@id3d46d5d66d7d86d9d:6d;d<6ZAd=eBfd>YZCe6d?ZDeDZEeEjFZGeCgejHD]\ZI\ZJZKeIeJf^qXZLe2eEd@eEd@t|drdSy |dWnttfk r9dSXdS(Ntshapeiti(thasattrt TypeErrort ValueError(tobj((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytis_string_likes cCsky |dWntk r tSXy-tjd|}|jd|jWntk rbtSXtSdS(sm p is a string pointing to a putative writable dir -- return True p is such a string, else False R tdirt1N(R tFalsettempfilet TemporaryFiletwritetclosetOSErrortTrue(tptt((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyt_is_writable_dirs    tVerbosecBseZdZdZegeeD]\ZZeef^q"ZdZ x4e j dD]%Z e jdsrqWne dZ qWWdZd Zd Zdd Zded Zd ZRS(s A class to handle reporting. Set the fileo attribute to any file instance to handle the output. Default is sys.stdout tsilentthelpfultdebugsdebug-annoyingis --verbose-i cCs|jdtj|_dS(NR(t set_leveltsyststdouttfileo(tself((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyt__init__s cCsS|jdk r|j}n||jkrFtd||jfn||_dS(s6set the verbosity to one of the Verbose.levels stringss1Illegal verbose string "%s". Legal values are %sN(t_commandLineVerbosetNonetlevelsR tlevel(R#R(((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyRs  cCszitjd6tjd6}||kr6|||_n@yt|d}Wn!tk rltd|n X||_dS(Ns sys.stdouts sys.stderrtwsfVerbose object could not open log file "%s" for writing. Check your matplotlibrc verbose.fileo setting(R R!tstderrR"tfiletIOErrorR (R#tfnametstdR"((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyt set_fileos    cCs$|j|r |j|IJtStS(s print message s to self.fileo if self.level>=level. Return value indicates whether a message was issued (tgeR"RR(R#tsR(((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytreports csItstfdt_j_S(s8 return a callable function that wraps func and reports it output through the verbose handler if current verbosity level is higher than level if always is True, the report will occur on every function call; otherwise only on the first time the function is called csQ||}sj rMj|}jsM|_qMn|S(N(t_spokeR2(targstkwargstrettspoke(talwaystfmttfuncR(R#twrapper(sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyR;s  (tcallabletAssertionErrorRR3t__doc__(R#R9R:R(R8((R8R9R:R(R#R;sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytwraps   cCs|j|j|j|kS(s%return true if self.level is >= level(tvaldR((R#R(((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyR0s(ssilentRsdebugsdebug-annoyingN(t__name__t __module__R>R'tdictt enumeratetiR(R@R&R%R Rtargt startswithR$RR/R2RR?R0(((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyRs1   cCstyRtjddgdtjdtj}|jjd}|jd}|SWntttfk rodSXdS(Ntdvipngs-versionR!R*ii( t subprocesstPopentPIPER!t readlinestsplitt IndexErrorR RR&(R1tlinetv((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytcheckdep_dvipng s cCsyftjdkr!ddg}n ddg}tj|dtjdtj}|jjd }|SWnttt fk rdSXdS(Ntwin32tgswin32cs --versiontgsR!R*i( R tplatformRIRJRKR!treadRNR RR&(t command_argsR1RP((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytcheckdep_ghostscripts  cCsyitjddgdtjdtj}|jjd}d}tj||}|jd}|SWntt t t fk rdSXdS(Nttexs-versionR!R*is3\.1\d+( RIRJRKR!RLtretsearchtgroupRNR tAttributeErrorRR&(R1ROtpatterntmatchRP((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyt checkdep_tex!s cCsybtjddgdtjdtj}x0|jD]%}d|kr4|jd}q4q4W|SWnttttfk rdSXdS(Ntpdftopss-vR!R*tversioni( RIRJRKR*RMRNR tUnboundLocalErrorRR&(R1RORP((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytcheckdep_pdftops-s  cCsyctjddgdtjdtj}x1|jD]&}d|kr4|jd}Pq4q4W|SWnttttfk rdSXdS(Ntinkscapes-VR!R*tInkscapei( RIRJRKR!RMRNR RcRR&(R1RORP((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytcheckdep_inkscape8s  cCsyctjddgdtjdtj}x1|jD]&}d|kr4|jd}Pq4q4W|SWnttttfk rdSXdS(Ntxmllints --versionR!R*Rbi( RIRJRKR*RMRNR RcRR&(R1RORP((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytcheckdep_xmllintDs  cCsI|rAtjj|}tjj|}||kr:tStSntSdS(s.return True if a is greater than or equal to bN(t distutilsRbt LooseVersionRR(tatb((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytcompare_versionsPs cCs|s tSt}d}d}t}t||r7n@t||r`tjd||fnt}tjd||dkrd}d}t}t||rqt||rt|d rqt}tjd|n|r|StSdS( Ns7.07s_ghostscript-%s found. ghostscript-%s or later is recommended to use the ps.usedistiller option.snmatplotlibrc ps.usedistiller option can not be used unless ghostscript-%s or later is installed on your systemtxpdfs3.0s0.9s1.0sgmatplotlibrc ps.usedistiller can not be set to xpdf unless xpdf-%s or later is installed on your system( RRRXRntverboseR2twarningstwarnRd(R1tflagtgs_reqtgs_suggtgs_vt pdftops_reqtpdftops_req_altt pdftops_v((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytcheckdep_ps_distillerYs:       c Cs|s tSd}d}d}d}t}t}t||rCnt}tjd|t}t||runt}tjdt}t||rn@t||rtj d||fnt}tjd||S(Ns3.1415s7.07s1.5sbmatplotlibrc text.usetex option can not be used unless TeX-%s or later is installed on your systemsqmatplotlibrc text.usetex can not be used with *Agg backend unless dvipng-1.5 or later is installed on your systemsaghostscript-%s found. ghostscript-%s or later is recommended for use with the text.usetex option.scmatplotlibrc text.usetex can not be used unless ghostscript-%s or later is installed on your system( RRR`RnRqRrRQRXRpR2( R1ttex_reqRtRut dvipng_reqRsttex_vtdvipng_vRv((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytcheckdep_usetex}s8       cCsd}ytjjd}WnnXtjj|s}xBdD]7}y'tj|}tjj|rkPnWq?q?Xq?Wn|r|StddS( sFind user's home directory if possible. Otherwise raise error. :see: http://mail.python.org/pipermail/python-list/2005-February/263921.html R t~tHOMEt USERPROFILEtTMPs(please define environment variable $HOMEN(sHOMERR(tostpatht expandusertisdirtenviront RuntimeError(Rtevar((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyt _get_homes    s$HOME=%sR8cCstjjd}|dk rAt|s=td|n|St}tjjtd}tjj |rt|std||fqn,t|std|ntj ||S(s Return the string representing the configuration dir. default is HOME/.matplotlib. you can override this with the MPLCONFIGDIR environment variable t MPLCONFIGDIRs$Could not write to MPLCONFIGDIR="%s"s .matplotlibs'%s' is not a writable dir; you must set %s/.matplotlib to be a writable dir. You can also set environment variable MPLCONFIGDIR to any writable directory where you want matplotlib data stored sxFailed to create %s/.matplotlib; consider setting MPLCONFIGDIR to a writable directory for matplotlib configuration dataN( RRtgetR&RRtget_homeRtjointexiststmkdir(t configdirthR((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyt_get_configdirs      s CONFIGDIR=%scCsdtjkrAtjd}tjj|s=tdn|Stjjtjjtdg}tjj|r{|Sddl }tjjtjj|j jdg}tjj|r|St t ddrtjjt j}tjj|d}tjj|r|Stjjtjj|dd}tjj|rT|Stjjt jdd}tjj|r|SntddS( sget the path to matplotlib datatMATPLOTLIBDATAs2Path in environment MATPLOTLIBDATA not a directorysmpl-dataiNtfrozenis(Could not find the matplotlib data files(RRRRRtsepRtdirnamet__file__tmatplotlib.afmtafmtgetattrR R&t executableRM(Rt matplotlibtexe_path((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyt_get_data_paths0 $ *%cCs4tdddkr(ttddRCRt iteritemsRtdefaultt converterRRRRRRR(((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pyRps1  cCst}tjj|sid}tgtjD]\}\}}||f^q1}tj||Sd}i}xt |D]} |d7}| j dddj } | sqn| j dd} t | dkrtjd|| |fqn| \}} |j }| j } ||krHtjd||fn| | |f||t __future__Rt __version__t __revision__t__date__RRZRRIR Rqtdistutils.sysconfigRjtdistutils.versionR RRtmatplotlib.rcsetupRRRRt version_infotmajortminor1tminor2R1ttmpt _python24Rt _havedatet ImportErrortnumpyRMtntinttnmajortnminorRRRRpRQRXR`RdRgRiRnRzRRR?RRRRRRRRRRRRRCRRRtcopyRRRRRRRRRRRRRRRRGRRR RRt__test__R2R(RURR(((sF/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/__init__.pytcsH  $" 5$  Q  $ )   '     7  7 U  1 H   %    !