;ò ¼ tDc@sœdkZdkZdkZdkZdkZdkZdkZeiddƒZeiddƒZ dfd„ƒYZ d„Z dei fd „ƒYZ dS( Ns BeginEPSFsU{ /b4_Inc_state save def /dict_count countdictstack def /op_count count 1 sub def userdict begin /showpage { } def 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit [ ] 0 setdash newpath /languagelevel where {pop languagelevel 1 ne {false setstrokeadjust false setoverprint } if } if } bindsEndEPSFst{ end count op_count sub {pop} repeat countdictstack dict_count sub {end} repeat b4_Inc_state restore } bindslinefilereadercBs>tZdZdd„Zedd„Zdd„Zd„ZRS(sa line by line file reader This line by line file reader allows for ' ', ' ' and ' ' as line separation characters. Line separation characters are not modified (binary mode). It implements a readline, a read and a close method similar to a regular file object.icCs(t|dƒ|_d|_||_dS(s„Opens the file filename for reading. typicallinelen defines the default buffer increase to find the next linebreak.srbsN(sopensfilenamesselfsfilesbufferstypicallinelen(sselfsfilenamestypicallinelen((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pys__init__Ds sunexpected end of filecCs|tj oš|t|iƒjo,|i|ii|t|iƒƒ7_n|tj ot|iƒ|jot|ƒ‚n|i| }|i||_|Sn]|i|iiƒ7_|tj ot|iƒ ot|ƒ‚n|i}d|_|SdS(s¥read bytes from the file count is the number of bytes to be read when set. Then count is unset, the rest of the file is returned. EOFmsg is used to raise a IOError, when the end of the file is reached while reading count bytes or when the rest of the file is empty when count is unset. When EOFmsg is set to None, less than the requested number of bytes might be returned.sN( scountsNoneslensselfsbuffersfilesreadsEOFmsgsIOErrorsresult(sselfscountsEOFmsgsresult((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pysreadRs ,#   cCsbd}xUnoM|iidƒ}|iidƒ}|djo,|djp|t|iƒdjo| o@|ii|i ƒ}t|ƒ o d}n|i|7_q t|iƒ}| o |t j ot|ƒ‚n|djo|d}n|djo|djp||djo|d}n|i| }|i||_|SqWdS(s†reads a line from the file Lines are separated by ' ', ' ' or ' '. The line separation strings are included in the return value. The last line might not end with an line separation string. Reading beyond the file generates an IOError with the EOFmsg message. When EOFmsg is None, an empty string is returned when reading beyond the end of the file.iis s iÿÿÿÿN(sEOFsselfsbuffersfindscrpossnlposslensfilesreadstypicallinelens newbufferseolsEOFmsgsNonesIOErrorsresult(sselfsEOFmsgsEOFsnlposseols newbufferscrpossresult((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pysreadlineks*<  + cCs|iiƒdS(scloses the fileN(sselfsfilesclose(sself((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pyscloseˆs(s__name__s __module__s__doc__s__init__sNonesreadsreadlinesclose(((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pyslinefilereader7s   cCs£t|ƒ}|iƒidƒ otdƒ‚nd}xnoø|iƒ}| oPn|idƒo| os|iddƒdiƒ}|dgjo d}q7t |ƒdjotd ƒ‚nt i t t|ƒŒSq<|iƒd jp5t |ƒd jo"|dd jo|dtijoPq<qCW| otd ƒ‚nd}xŽno†|iƒ}|idƒo`|iddƒdiƒ}t |ƒdjotdƒ‚nt |ƒdjo||d djo/xdtt|dƒƒD]}|iƒqúWqe|d djotdƒ‚qe|it|dƒƒn|it|dƒƒ|iƒ}t |ƒdjp|d djot |iƒƒ o|iƒ}n|iƒdjotdƒ‚qæq]|idƒoz|it|iddƒdƒƒ|iƒ}t |iƒƒ o|iƒ}n|iƒdjotdƒ‚qæq]|idƒo|d7}q]|iƒdjo+|djotdƒ‚n|d8}q]| o|iƒdjoPq]qdWt}t}x‰|o|idtƒ}|idƒo[|iddƒdiƒ}t |ƒdjotd ƒ‚nt i t t|ƒŒ}qúqúW| otdƒ‚n|SdS( s)returns bounding box of EPS file filenames%!s-file doesn't start with a '%!' header commentiis%%BoundingBox:s:s(atend)is%invalid number of bounding box valuess %%EndCommentsis%s!no bounding box information founds %%BeginData:isinvalid number of argumentssLinessBytessinvalid bytesorlines-values %%EndDatasmissing EndDatas%%BeginBinary:s %%EndBinarysmissing EndBinarys%%BeginDocument:s %%EndDocumentsunmatched EndDocuments %%TrailersEOFmsgs4missing bounding box information in document trailerN(slinefilereadersfilenamesfilesreadlines startswithsIOErrors bboxatendslinessplitsvaluesslensbboxsbbox_ptsmapsintsrstripsstrings whitespacesnestingsxrangesisreadsstripsNonesusebboxsTrue(sfilenamesisvaluessfiles bboxatendslinesusebboxsnesting((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pys _readbboxsŽ   K   8#   !sepsfilec BsJtZdZeeedddedd„Zd„Zd„Zd„ZRS(sclass for epsfilessbliic Csqti|ƒ|_ti|ƒ|_| oti |ti ƒ|_ n ||_ | p t |i ƒ|_||_|_|tj p |tj oÏ|tj otdƒ‚n|tj o*ti|ƒ|ii|ii|_n|tj o*ti|ƒ|ii|ii|_n|itjo|i|_n|itjo|i|_qbn|ii|ii|_|io|i|i9_n|ii|ii|_|io|i|i9_n||_|iddjone|iddjo|i|id8_n7|iddjo|i|i8_n tdƒ‚|idd jone|iddjo|i|id8_n7|idd jo|i|i8_n td ƒ‚||_| |_ti |i|iƒ|_|itj o&|iti!|i|iƒ|_n| o.|iti |ii |ii ƒ|_nd S( sinserts epsfile Object for an EPS file named filename at position (x,y). Width, height, scale and aligment can be adjusted by the corresponding parameters. If clip is set, the result gets clipped to the bbox of the EPS file. If translatebbox is not set, the EPS graphics is not translated to the corresponding origin. If bbox is not None, it overrides the bounding box in the epsfile itself. If kpsearch is set then filename is searched using the kpathsea library. s<cannot set both width and/or height and scale simultaneouslyisbscf2.0stsAvertical alignment can only be b (bottom), c (center), or t (top)islsrsChorizontal alignment can only be l (left), c (center), or r (right)N("sunitstoptsxsselfsx_ptsysy_ptskpsearchs pykpathseas find_filesfilenameskpse_pict_formatsbboxs _readbboxsmybboxsscalesscalexsscaleyswidthsNonesheights ValueErrorsury_ptslly_ptsurx_ptsllx_ptswidth_pts height_ptsalignsclips translatebboxstrafos translate_ptsscale_pt( sselfsxsysfilenameswidthsheightsscalesalignsclips translatebboxsbboxskpsearch((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pys__init__çs^   * *       &cCs|ii|iƒSdS(N(sselfsmybboxs transformedstrafo(sself((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pysbbox8sc Cs"|itƒ|itƒ||iƒ7}yt|idƒ}Wnt d|i‚nX|i dƒ|i oP|i i|iƒiƒ\}} }} |i d|| ||| | fƒn|ii|||||ƒ|i d|iƒ|i |iƒƒ|i dƒ|i dƒdS(Nsrbscannot open EPS file '%s's BeginEPSF s%g %g %g %g rectclip s%%%%BeginDocument: %s s%%EndDocument sEndEPSF (sregistrysadds _BeginEPSFs_EndEPSFsbboxsselfsopensfilenamesepsfilesIOErrorsfileswritesclipsmybboxs transformedstrafoshighrestuple_ptsllx_ptslly_ptsurx_ptsury_pts processPSswriterscontextsread( sselfsfileswriterscontextsregistrysbboxsepsfilesllx_ptsurx_ptsury_ptslly_pt((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pys processPS;s     ') cCstdƒ‚dS(Ns.Including EPS files in PDF files not supported(s RuntimeError(sselfsfileswriterscontextsregistrysbbox((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pys processPDFQs(s__name__s __module__s__doc__sNones__init__sbboxs processPSs processPDF(((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pysepsfileãs !Q  (sstringscanvassbboxs pykpathseasunitstrafospswriters PSdefinitions _BeginEPSFs_EndEPSFslinefilereaders _readbboxs canvasitemsepsfile( s pykpathseascanvassepsfiles _BeginEPSFsstringspswriterslinefilereadersbboxs _readbboxs_EndEPSFsunitstrafo((s?/mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/epsfile.pys?s 6    V V