łň / Mc @s]dZddkZddkZddkZddkZeidƒZeidƒZdZei i edƒZ dZ dZ d d d gZd „Zd „Zd„Zd„Zd„Zddd„Zdd„ZedjozeƒZedZeGHx_eD]SZeGHee\ZZxeD]ZdeGHq WxeD]ZdedGHq:WqţWndS(s^ Read the Single Particle Reconstruction web page: /usr8/spider/docs/techs/recon/mr.html Generate an object containing the subdirectories and their batch files. Expects each section to begin with: "These procedures should be run in the Directory directory." Subdirectories need to have the format: "Subdirectory(ies): dir1, dir2" Loads anything in a link in the 'newprogs' directory. --- Usage: D = read_spr_page.getproject() returns a dictionary D where D.keys() = [project directories] D[dir] = ( [procs], [subdirs] ) A special key 'dirlist' has an ordered list of directories. i˙˙˙˙Ns#[sS]ubdirector(y|ies) *: *.+s ' tsubdirectoriesit=Rs-->t,(RRRtreplacetsplittappendR(RtsubsRR tsstsub((sH/local/valcour.usr10/user8-copy/spider/docs/techs/recon/read_spr_page.pytgetSubdirectoriesKscCsPti|dƒ}|djo)||d}ti|ƒ}|dSndSdS(s1 gets xxx from '' Ri˙˙˙˙iiRN(RRR(RRtd((sH/local/valcour.usr10/user8-copy/spider/docs/techs/recon/read_spr_page.pyt getDirectory[s   cCs t|ƒ}tii|ƒdS(s: get x.bat from a line of text i˙˙˙˙(RtostpathR(Rtbatfile((sH/local/valcour.usr10/user8-copy/spider/docs/techs/recon/read_spr_page.pyt get_batfilefs cCs‚|d jo t}nt|dƒ}|iƒ}|iƒd}d}|d joh}g}n5|}|idƒo|d}ng}||dtdirlistiRis-->s1read_spr_page.py: unable to get directory from %si˙˙˙˙N(tNonet default_pagetopent readlinestclosethas_keyRRRtre_spiretsearchR%tstrR$R#RtbatdirR)R&R'tsplitexttbatext(tfilenametdirobjtfptBt dirstringt endstringtDR+tlendstrR R R tprocstoldprocsR toldsubstdirnameRt newdirnametnewsubstproctfnametexttp((sH/local/valcour.usr10/user8-copy/spider/docs/techs/recon/read_spr_page.pyt readSPRpageks          *                 cCs°|djo.tiitdƒtiitdƒg}n't|ƒtdƒjo |g}nh}xB|D]:}tii|ƒ\}}ti|ƒt||ƒ}qnW|S(Nsmr.htmls refine.htmlR( R,R&R'tjoint source_dirttypeRtchdirRJ(twebpagesR>twebpagetwebdirtwebfile((sH/local/valcour.usr10/user8-copy/spider/docs/techs/recon/read_spr_page.pyt getprojectĹs   t__main__R+s t/(t__doc__R&Rtsystretcompilet re_subdirsR2RLR'RKR-t topLevelDirR5R7RRR#R%R)R,RJRSt__name__R>tdirstdirR@tsubdirsRFR"(((sH/local/valcour.usr10/user8-copy/spider/docs/techs/recon/read_spr_page.pyss<$     Z