; ~4Gc@sdkZdkZdkZdkZdkZdkZdkZdkZdk Z dk Z dk Z dk Z dk Z dkZeid\ZZZZdZdZeZdefdYZdfdYZdfd YZd fd YZd e ifd YZde ifdYZde ifdYZ de i!fdYZ"de i!fdYZ#de i$fdYZ%de i&fdYZ'dfdYZ(dfdYZ)dfdYZ*d e i+fd!YZ,d"e i+fd#YZ-d$eifd%YZ.d&e i+fd'YZ/d(e i0fd)YZ1d*e i2fd+YZ3d,fd-YZ4e5d.joe'i6ndS(/Ns iso-8859-1cCst|dS(Ni(s _isoEncodersx(sx((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys9scCst|dS(Ni(s _isoDecodersx(sx((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys;ss FileExceptioncBstZdZdZRS(s^ is the subclass for all file and xml related things that can go wrong in this module cCs ||_dS(s= takes the reason or explanation as argument N(sreasonsself(sselfsreason((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__Cs(s__name__s __module__s__doc__s__init__(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys FileException?s sGatoStorageCachecBstZdZRS(sG singleton list for all accessed/used/cached storage locations (s__name__s __module__s__doc__(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysGatoStorageCacheIs sGatoStorageLocationcBshtZdZedZddZdZdZedZedZ edZ ed Z RS( s bundle of common functions for file load/save/selection These functions act on the level of graphs and algorithms. they propagate the open and save calls to the different file implementations cCs ||_dS(s8 opens the file and prepares the access N(sfileNamesself(sselfsfileName((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__VssrwcCsdS(se opens a suitable dialog to choose a possible location for reading/writing gato data N((sselfs accessMode((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyschooseLocation\scCsd|ii|ifSdS(s8 a short representation of the instance s<%s: %s>N(sselfs __class__s__name__sfileName(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__repr__ascCs |iSdS(sH should display the name in human understandable manner N(sselfsfileName(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__str__gscCsdS(s( returns a Graph object N((sselfs whichGraph((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys readGraphmscCsdS(s- returns an Algorithm object N((sselfswhichAlgorithm((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys readAlgortihmsscCsdS(s: puts a graph to the collection of graphs N((sselfsGraphs whichGraph((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys writeGraphyscCsdS(s> puts a graph to the collection of algorithms N((sselfs AlgorithmswhichAlgorithm((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyswriteAlgorithms( s__name__s __module__s__doc__sNones__init__schooseLocations__repr__s__str__s readGraphs readAlgortihms writeGraphswriteAlgorithm(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysGatoStorageLocationOs        sGatoStorageLocationTestcBstZdZdZRS(s, some tests for GatoStorageLocation cCs%td}d|t|fGHdS(Nsblas,human readable: %s, python representation %s(sGatoStorageLocationslsrepr(sselfsl((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__s (s__name__s __module__s__doc__s__init__(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysGatoStorageLocationTests s GatoDirBranchcBstZdZdZRS(s cCs|i}g|_g}yti|i}Wntj onX|it d|}x|D]}||jo!|ii ||i |qgtii|i|}tii|o#|ii td|d|qgtii|o|ddjo#|ii td|d|q|ddjo#|ii td|d|q|ddjotii|d d o#|ii td|d|q|dd jo#|ii td|d|qqgqgWd S( s< create/update child list suitable for gato cCs|iS(N(scsname(sc((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysssparentsnameis.gatois.xmls.algs.pros.catN(sselfschildrens oldChildrensentriessosslistdirspathsOSErrorssortsmaps oldEntriessentrysappendsindexsjoins entrypathsisdirs GatoDirBranchsisfilesGatoFileBranchsxmlGatoFileBranchsalgLeafscatLeaf(sselfs oldEntriessentriess entrypathsentrys oldChildren((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysupdateChildLists4    !###,#(s__name__s __module__s__doc__supdateChildList(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys GatoDirBranchs sGatoFileBranchcBstZdZRS(s9 ToDo: supports xml files with gato root section (s__name__s __module__s__doc__(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysGatoFileBranchs sxmlGatoFileBranchcBstZdZRS(s; ToDo supports xml files with gato sections inside (s__name__s __module__s__doc__(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysxmlGatoFileBranchs salgLeafcBstZdZeedZRS(s old algortithm file cCs)tii|d|d|d|_dS(Nsparentsnamei(s TreeWidgetsLeafs__init__sselfsparentsnames selectable(sselfsparentsname((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__s(s__name__s __module__s__doc__sNones__init__(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysalgLeafs scatLeafcBstZdZeedZRS(s old graph file cCs)tii|d|d|d|_dS(Nsparentsnamei(s TreeWidgetsLeafs__init__sselfsparentsnames selectable(sselfsparentsname((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__s(s__name__s __module__s__doc__sNones__init__(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyscatLeafs sGatoTreecBstZdZdZRS(s csDtii||td|dddddf|_|iiti } g}x@| |ii jo,ti i| \} |idqYW|i} | ix4|D],td| id} | iqW| i\}}}} |iti\}}} }|i!ti"t#|t#||dS(Nsparentsnames/sanchoriics |ijS(N(sxsnamespiece(sx(spiece(s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyss($s TreeWidgets scrolledTrees__init__sselfsmasters GatoDirBranchsrootsdisplaysossgetcwdscurrents currentListsnamespathssplitspiecesinsertsthisNodesexpandsfilterschildrensgetBoundingBoxsNx0sNy0sNx1sNy1sbboxsTkintersALLsCx0sCy0sCx1sCy1syviewsMOVETOsfloat(sselfsmastersCx0s currentListsCy1sCy0sNx1sNx0sNy0sCx1sthisNodesNy1scurrentspiece((spieces5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__s$$    (s__name__s __module__s__doc__s__init__(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysGatoTrees sWorkInProgresscBs tZdZdZdZRS(s' my development and test class cCs?tii|t||_|iidddtidS(Nsexpandisfill(sTkintersTks__init__sselfsGatoTreestreespacksBOTH(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__scCs|idS(N(sselfsmainloop(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysruns(s__name__s __module__s__doc__s__init__srun(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysWorkInProgresss  sxmlAlgorithmElementcBstZdZdZdZdZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZRS(Ns algorithmstextsprologsaboutcCs@|i|ijo td|i|ifn||_dS(Ns#Wrong element name: %s, %s expected(sdomstagNamesselfsalgorithmElementNames FileExceptions domElement(sselfsdom((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__s cCsti}|i||i|i|i|i |d d}t i |t i o|it|in d|GHdS(s7 writes algorithm data to xml sections is.pros&Warning: could not read prolog file %sN(sGatos Algorithms algorithmsOpensfileNamesselfs setAlgorithmssourcessetAboutsAboutsPrologFileNamesossaccesssR_OKs setPrologsfilesread(sselfsfileNames algorithmsPrologFileName((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssetAlgorithmFromALGFiles  cCst}|iio>|iii|i}|i|iiit |n5t i i |i}|it i it ||ii|i}t|djo|ii||dn|ii|dS(s4 creates/repaces the prolog section iN(sNones newPrologsselfs domElements ownerDocuments createElementsprologElementNames appendChildscreateCDATASections xmlEncodestextsxmlsdomsElements CDATASectionsgetElementsByTagNamesexistingPrologslens repaceChild(sselfstextsexistingPrologs newProlog((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys setPrologs &cCst}|iio>|iii|i}|i|iiit |n5t i i |i}|it i it ||ii|i}t|djo|ii||dn|ii|dS(s7 creates/repaces the algorithm section iN(sNones newAlgorithmsselfs domElements ownerDocuments createElementssourceElementNames appendChildscreateCDATASections xmlEncodestextsxmlsdomsElements CDATASectionsgetElementsByTagNamesexistingAlgorithmslens repaceChild(sselfstextsexistingAlgorithms newAlgorithm((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys setAlgorithm$s &cCsdS(s ToDo N((sselfstext((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssetAbout9scCs|ii|}t|djotSn|d}d}xZ|i D]O}|i t i iiijp|i t i iiijo||i7}qGqGWt|SdS(s!returns the text of specified tagiisN(sselfs domElementsgetElementsByTagNamestagNamesrequestedElementsslensNonesrequestedElementstexts childNodessesnodeTypesxmlsdomsminidomsNodes TEXT_NODEsCDATA_SECTION_NODEsdatas xmlDecode(sselfstagNamesrequestedElementsestextsrequestedElements((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetTextFromElement?s  8cCs)|i|i}|o|SndSdS(Ns(sselfsgetTextFromElementssourceElementNamest(sselfst((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetTextLscsHtdii}t|djotSn|diSdS(Ncs)|itiiijo|iijS(N( sesnodeTypesxmlsdomsNodes ELEMENT_NODEstagNamesselfsaboutElementName(se(sself(s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysTsii(sfiltersselfs domElements childNodessrequestedElementsslensNonestoxml(sselfsrequestedElements((sselfs5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetAboutAsStringSs  cCsti|iSdS(s5 creates a StringIO Object from file N(sStringIOsselfsgetText(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys getTextAsFile\scCs)|i|i}|o|SndSdS(sreturns the prologsN(sselfsgetTextFromElementsprologElementNamesp(sselfsp((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys getPrologbs cCsti|iSdS(N(sStringIOsselfs getProlog(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetPrologAsFilejscCst|iidSdS(Nsname(s xmlDecodesselfs domElements getAttribute(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetNamemscCs|iidt|dS(Nsname(sselfs domElements setAttributes xmlEncodesname(sselfsname((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssetNameps(s__name__s __module__salgorithmElementNamessourceElementNamesprologElementNamesaboutElementNames__init__ssetAlgorithmFromALGFiles setPrologs setAlgorithmssetAboutsgetTextFromElementsgetTextsgetAboutAsStrings getTextAsFiles getPrologsgetPrologAsFilesgetNamessetName(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysxmlAlgorithmElements"          sxmlGraphElementcBsYtZdZedZdZdZdZdZdZ dZ d Z RS( NsgraphcCst|itiiio@|i|i jo t d|i|i fn||_ nrt|it i ot |tijo9tiiiti |_ |i||i|n t ddS(s called with a dom element: grants access to Graph called with a graph and a name string: creates the dom structure from graph s#Wrong element name: %s, %s expectedswrong arguments providedN(s issubclasssgraphs __class__sxmlsdomsminidomsElementstagNamesselfsgraphElementNames FileExceptions domElementsGraphstypesnamestypess StringTypessxmlGraphElementssetNamessetGraph(sselfsgraphsname((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__ws  , cCsEtd|ii}t|djotSn|diSdS(NcCs&|itiiijo |idjS(Nsabout(sesnodeTypesxmlsdomsNodes ELEMENT_NODEstagName(se((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssii(sfiltersselfs domElements childNodessrequestedElementsslensNonestoxml(sselfsrequestedElements((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetAboutAsStrings  cCsti|iSdS(sM returns the Graph object constructed from this dom element N(s GraphUtilsOpenCATBoxGraphsselfsgetGraphAsStringIO(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetGraphscCsti}xf|iiD]X}|itii i i jp|itii i i jo|i t|iqqW|id|SdS(Ni(sStringIOstextsselfs domElements childNodessesnodeTypesxmlsdomsminidomsNodes TEXT_NODEsCDATA_SECTION_NODEswrites xmlDecodesdatasseek(sselfsestext((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetGraphAsStringIOs  8 cCsti}ti||td|ii}t |ii |t }|iio%|iiit|i}n"tiiit|i}|ii|dS(NcCs5|itiiiijp|itiiiijS(N(sesnodeTypesxmlsdomsminidomsNodes TEXT_NODEsCDATA_SECTION_NODE(se((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyss(sStringIOsdatas GraphUtilsSaveCATBoxGraphsgraphsfiltersselfs domElements childNodess textNodessmaps removeChildsNonesnewCDATASections ownerDocumentscreateCDATASections xmlEncodesgetvaluesxmlsdomsminidoms CDATASections appendChild(sselfsgraphsnewCDATASectionsdatas textNodes((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssetGraphs   %!cCs|iti|dS(sv creates a graph object from .cat file and sets it this detour assures an actual graph format N(sselfssetGraphs GraphUtilsOpenCATBoxGraphs GraphFile(sselfs GraphFile((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssetGraphFromCATFilescCst|iidSdS(Nsname(s xmlDecodesselfs domElements getAttribute(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetNamescCs|iidt|dS(Nsname(sselfs domElements setAttributes xmlEncodesname(sselfsname((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssetNames( s__name__s __module__sgraphElementNamesNones__init__sgetAboutAsStringsgetGraphsgetGraphAsStringIOssetGraphssetGraphFromCATFilesgetNamessetName(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysxmlGraphElementss      sxmlGatoElementcBstZdZdZdZedZedZdZdZ dZ dZ d Z d Z d Zd Zd ZdZedZedZdZdZRS(sL is an access and modification interface to the gato dom structure sgatocCs@|i|ijo td|i|ifn||_dS(s? creates the access and modification interface s#Wrong element name: %s, %s expectedN(s _domElementstagNamesselfsgatoElementNames FileExceptions domElement(sselfs _domElement((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__s cCsvt}|iio|iiiti}nti i ti}t|}|tj o|i |n|SdS(s- creates a new graph Element N(sNones newDOMElementsselfs domElements ownerDocuments createElementsxmlGraphElementsgraphElementNamesxmlsdomsElements newElementsnamessetName(sselfsnames newElements newDOMElement((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyscreateGraphElements   cCsvt}|iio|iiiti}nti i ti}t|}|tj o|i |n|SdS(s1 creates a new algorithm element N(sNones newDOMElementsselfs domElements ownerDocuments createElementsxmlAlgorithmElementsalgorithmElementNamesxmlsdomsElements newElementsnamessetName(sselfsnames newElements newDOMElement((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyscreateAlgorithmElements   cCs|iidt|dS(s: sets the name attribute for this element snameN(sselfs domElements setAttributes xmlEncodesname(sselfsname((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssetNamescCst|iidSdS(sI gets the name of this element, if unset an empty string snameN(s xmlDecodesselfs domElements getAttribute(sselfsname((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetNamescCsEtd|ii}t|djotSn|diSdS(NcCs&|itiiijo |idjS(Nsabout(sesnodeTypesxmlsdomsNodes ELEMENT_NODEstagName(se((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssii(sfiltersselfs domElements childNodessrequestedElementsslensNonestoxml(sselfsrequestedElements((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetAboutAsStrings  cCstd|iiSdS(sH returns all direct child elements with graph's tagName cCs,|itiiiijo|iti jS(N( sxsnodeTypesxmlsdomsminidomsNodes ELEMENT_NODEstagNamesxmlGraphElementsgraphElementName(sx((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys sN(sfiltersselfs domElements childNodes(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetGraphElementss cCstd|iiSdS(sL returns all direct child elements with algorithm's tagName cCs,|itiiiijo|iti jS(N( sxsnodeTypesxmlsdomsminidomsNodes ELEMENT_NODEstagNamesxmlAlgorithmElementsalgorithmElementName(sx((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssN(sfiltersselfs domElements childNodes(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetAlgorithmElementss cCstd|iSdS(s* extracts all graph names cCst|idS(Nsname(s xmlDecodesxs getAttribute(sx((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssN(smapsselfsgetGraphElements(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys getGraphNamess cCstd|iSdS(s. extracts all algorithm names cCst|idS(Nsname(s xmlDecodesxs getAttribute(sx((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys#sN(smapsselfsgetAlgorithmElements(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetAlgorithmNamess cs-td|i}t|dSdS(s4 gets a xmlGraphElement by its name cs|idjS(Nsname(sxs getAttributesname(sx(sname(s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys*siN(sfiltersselfsgetGraphElementssgraphssxmlGraphElement(sselfsnamesgraphs((snames5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetGraphByName&s cs-td|i}t|dSdS(s8 gets a xmlAlgorithmElement by its name cs|idjS(Nsname(sxs getAttributesname(sx(sname(s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys2siN(sfiltersselfsgetAlgorithmElementssgraphssxmlAlgorithmElement(sselfsnamesgraphs((snames5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetAlgorithmByName.s cCsh}|i}|i}t|djot|djodt|djo|i|d|d`siN(sNonesnewGraphsnewNames issubclasssgraphs __class__sGraphsxmlGraphElementsnamessetNamesgetNames FileExceptionsfiltersselfsgetGraphElementssgraphsslens domElements replaceChilds appendChild(sselfsgraphsnamesgraphssnewNamesnewGraph((snames5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysupdateGraphByNameOs    cst}t}t|itiot|}nNt|ito.|}o|i q|i n t dt d|i}t|o|ii|itdn|ii|idS(s2 appends or replaces an algorithm sargument mismatch!cs|idjS(Nsname(sxs getAttributesname(sx(sname(s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyszsiN(sNones newAlgorithmsnewNames issubclasss algorithms __class__sGatos AlgorithmsxmlAlgorithmElementsnamessetNamesgetNames FileExceptionsfiltersselfsgetAlgorithmElementss algorithmsslens domElements replaceChildsgraphss appendChild(sselfs algorithmsnamesnewNames newAlgorithms algorithms((snames5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysupdateAlgorithmByNameis    cs2td|i}t|ii|dS(s) removes the named graph cs|idjS(Nsname(sxs getAttributesname(sx(sname(s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssN(sfiltersselfsgetGraphElementssgraphssmaps domElements removeChild(sselfsnamesgraphs((snames5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysremoveGraphByNames cs2td|i}t|ii|dS(s- removes the named algorithm cs|idjS(Nsname(sxs getAttributesname(sx(sname(s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssN(sfiltersselfsgetAlgorithmElementss algorithmssmaps domElements removeChild(sselfsnames algorithms((snames5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysremoveAlgorithmByNames (s__name__s __module__s__doc__sgatoElementNames__init__sNonescreateGraphElementscreateAlgorithmElementssetNamesgetNamesgetAboutAsStringsgetGraphElementssgetAlgorithmElementss getGraphNamessgetAlgorithmNamessgetGraphByNamesgetAlgorithmByNamesgetDefaultSelectionsupdateGraphByNamesupdateAlgorithmByNamesremoveGraphByNamesremoveAlgorithmByName(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysxmlGatoElements&                sElementDisplaycBs)tZdZdZdZdZRS(s' displays the selected element cKsa|ihdd<dd<tii||ddd||idt|_ t|_ dS( s swidthisheightsbgswhitescnfiN( sconfigsupdatesTkintersFrames__init__sselfsmasterspack_propagatesNonesdisplayedWidgets displayedNode(sselfsmastersconfig((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__s   cCs;x+|iiD]}|i|iqWt|_dS(s- cleanup and display nothing N(sselfschildrensvaluesschilds pack_forgetsdestroysNones displayedNode(sselfschild((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys clearDisplays  cCs?|tjo|idSn)|itj o |i|jodSn|it}|itijo.t|i }t ||}||_n|it i jo"t|t |}||_nK|itijo.t|i }t ||}||_n dG|GH|o|idddtindS(s! display node... NstoDo: sexpandisfill(snodesNonesselfs clearDisplays displayedNodesdisplayedWidgetstagNamesxmlGraphElementsgraphElementNamesgetAboutAsStrings html_datas AboutWidgetsxmlAlgorithmElementsalgorithmElementNamesAlgorithmInfoWidgetsxmlGatoElementsgatoElementNamespacksTkintersBOTH(sselfsnodesdisplayedWidgets html_data((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys setDisplays,        (s__name__s __module__s__doc__s__init__s clearDisplays setDisplay(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysElementDisplays  sAlgorithmInfoWidgetcBstZdZdZRS(s% creates an algorithm widget cCstii||dd|i}t|||_ |i i dti dddti |i }ti|ddd d d d |_|iiti||ii dti dddti ti|id No information avaliable ! sstates0.0(shtmlcodesNones formatters GatoDialogssTkintersNORMALsselfsdeletesENDs HTMLWriterswritersAbstractFormattersformats MyHTMLParsersparsersfeedsclosesDISABLED(sselfshtmlcodes GatoDialogssparsersformatswriters formatter((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys inserthtmls       (s__name__s __module__s__doc__s__init__sUpdates inserthtml(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys AboutWidgets   sGatoFileButtonBarcBstZdZhdZRS(s9 holds the buttons for the node selection dialog c s|i|tii|d||_ti dddt d_ i i ddddd ti titi dd dt d _ii dddd d ti tiidd d id d d dS(NscnfstextsOkscommandcs idS(Nsquit(sselfsreporter(se(sself(s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys ssrowiscolumnsstickysCancelcs idS(Nscancel(sselfsreporter(se(sself(s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssisweight(scnfsupdatesconfigsTkintersFrames__init__sselfsmastersreportersButtonsNonesokButtonsgridsEsWs cancelButtonscolumnconfigure(sselfsmastersreporterscnfsconfig((sselfs5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__s  ')')(s__name__s __module__s__doc__s__init__(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysGatoFileButtonBars sGatoFileStructureWidgetcBsDtZdZdZdZdZdZdZdZRS(s$ customized for .gato files c Ks>tii||||iddd|h|_||_ dS(sA report function coordinates the element display swidthiscnfN( sTextTreeWidgetsdom_structure_widgets__init__sselfsmastersdoms report_funcsconfs chosenNodessreport_functions report_to(sselfsmastersdomsreport_functionsconf((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__s( cGs|djoHt|djp|dtjodSn|d}|itijo=|i o|i || odSn|i |tin|i |djodSn|it i jo=|i o|i || odSn|i |t i q|itijo=|i o|i || odSn|i |tiqno|djoXt|djp|dtjodSn|d}|i o|i ||qn |G|GHdS(s: reports nodes that are marked aka chosen s chosenNodeiiNs selectedNode(seventslensoptssNonesnodestagNamesxmlGatoElementsgatoElementNamesselfs report_tos chosenNodesisGatoMemberElementsxmlAlgorithmElementsalgorithmElementNamesxmlGraphElementsgraphElementName(sselfseventsoptssnode((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys report_func!s4 $  $  cCsl|ii|}|o|i|dn||jot|i|tZdZddffdZdZdZdZRS(s contains the xml structure and the display of selected element and some buttons opt_choose contains the elements, that may be chosen mand_choose contains the elements, that must be choosen s algorithmsgraphc s|_|_|_h_tii|d|t ii dd_ i i dddddtitdd _ii dddd dtiti_ii dd ddd d dtiid tddS(s create it scnfsfontsTimes 12srowiscolumnsstickyswidthiis columnspanisWM_DELETE_WINDOWcs idS(Nscancel(sselfsreportFromButtons(se(sself(s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyssN(sdomsselfs opt_chooses mand_choosesresultsTkintersToplevels__init__smastersconfigsGatoFileStructureWidgetsreportFromStructures struct_widgetsgridsNSEWsElementDisplaysdisplay_widgetsGatoFileButtonBarsreportFromButtonssbuttonssEWsprotocolsNone(sselfsmastersdoms opt_chooses mand_choosesconfig((sselfs5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys__init__s    !""(cCs|djo|ii|n`|djoR|o<|itiii jo#|i |i jp|i |i jodSqndS(s- coordinates element display s selectedNodes chosenNodeiN( seventsselfsdisplay_widgets setDisplaysnodesnodeTypesxmlsdomsNodes ELEMENT_NODEstagNames opt_chooses mand_choose(sselfseventsnode((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysreportFromStructures   FcCsc|djo|iiiti}|ot||iti N(sNones _thisFiles_filestypestypess StringTypess encodedStreamsfilesFileTypesselfsencodingswritesdoms hasChildNodess childNodessnswritexmlsxmlEncodedStream(sselfs_filesencodings _thisFilesn((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyswrites   cCsI|ii p|iiitijotSnt|iiiSdS(s7 returns the default selected elements N(sselfsdomsdocumentElementstagNamesxmlGatoElementsgatoElementNamesNonesgetDefaultSelection(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetDefaultSelection.s'cCs|iitiSdS(s4 returns an xmlGatoElement instance N(sselfsdomsgetElementsByTagNamesxmlGatoElementsgatoElementName(sself((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysgetGatoElements8scCs|iiou|iiitijoB|ii}|ii|ii d||iii |n|iii |i n|ii |i dS(sA append the element without checking unique name sxmlN( sselfsdoms hasChildNodessdocumentElementstagNamesxmlGatoElementsgatoElementNamestmpGatoElements replaceChilds createElements appendChilds newElements domElement(sselfs newElementstmpGatoElement((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysappendGatoElement>s cCsAt|iiti}|tj o|i|n|SdS(s< creates a new (opt. unnamed) Gato element N( sxmlGatoElementsselfsdoms createElementsgatoElementNames newElementsnamesNonessetName(sselfsnames newElement((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pyscreateGatoElementNs  cCs t||i}|iSdS(s( runs the dom structure N(s GatoDOMDialogsmastersselfsdomswsrun(sselfsmastersw((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysdisplaySelectionDialogWscCsBt||iddf}|i}|o |dSntSdS(Ns to_choosesgraph(s GatoDOMDialogsmastersselfsdomswsrunsssNone(sselfsmastersssw((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysdisplayGraphSelectionDialog^s   cCsBt||iddf}|i}|o |dSntSdS(Ns to_chooses algorithm(s GatoDOMDialogsmastersselfsdomswsrunsssNone(sselfsmastersssw((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysdisplayAlgorithmSelectionDialogfs   (s__name__s __module__s__doc__s validModessNones__init__swritesgetDefaultSelectionsgetGatoElementssappendGatoElementscreateGatoElementsdisplaySelectionDialogsdisplayGraphSelectionDialogsdisplayAlgorithmSelectionDialog(((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pysGatoFiles  2     s__main__(7ssyssosstypesscodecssStringIOsurllib2sxml.dom.minidomsxmlsGatosGraphs GraphUtilsTkinters TreeWidgetsTextTreeWidgets ScrolledTextslookups _isoEncoders _isoDecoders_isoStreamReaders_isoStreamWriters xmlDecodes xmlEncodesxmlEncodedStreams Exceptions FileExceptionsGatoStorageCachesGatoStorageLocationsGatoStorageLocationTests DirBranchs GatoDirBranchs xmlFileBranchsGatoFileBranchsxmlGatoFileBranchsLeafsalgLeafscatLeafs scrolledTreesGatoTreesTksWorkInProgresssxmlAlgorithmElementsxmlGraphElementsxmlGatoElementsFramesElementDisplaysAlgorithmInfoWidgets AboutWidgetsGatoFileButtonBarsdom_structure_widgetsGatoFileStructureWidgetsToplevels GatoDOMDialogsGatoFiles__name__srun(*sGatoFileBranchsGraphsAlgorithmInfoWidgetsGatosTextTreeWidgets _isoDecodersGatoStorageCachesxmlsGatoFiles GraphUtilsalgLeafs FileExceptionsxmlGatoFileBranchsxmlEncodedStreamsGatoFileStructureWidgets _isoEncodersxmlGraphElements xmlDecodes_isoStreamWritersTkinters xmlEncodesElementDisplaysurllib2ssyss_isoStreamReaders TreeWidgetscodecss ScrolledTextsGatoStorageLocationsGatoFileButtonBarstypessGatoTreescatLeafsStringIOsGatoStorageLocationTests GatoDirBranchs AboutWidgets GatoDOMDialogsxmlGatoElementsossWorkInProgresssxmlAlgorithmElement((s5/mnt/gmirror/ports/math/py-gato/work/Gato/GatoFile.pys?"sP                 6 "P5%{P