Annotation of OSA_system2/OSAS_helpers.pyc, revision 1.9

1.8       dwinter     1: ;
1.9     ! dwinter     2: |Ac@sdkZ&d&kTdkZdkZddddddgZdd   gZd
1.8       dwinter     3: ZdZ dZ
1.9     ! dwinter     4: d
ZdZdZ
dZdZdZdZdS(N(&s&*sOSAS_metaDataFilesOSAS_dirs  OSAS_filesOSAS_imageFoldersOSAS_dir_archivesOSAS_file_archivesTheVolumeSettingsFoldersTheFindByContentFolderc&CsCd&}x2|D]*}&|&i|&ijo&||&i}q
&q
W|SdS(sgibt text aus nodelistsN(srcsnodelistsnodesnodeTypes  TEXT_NODEsdata(snodelistsnodesrc((s8/usr/local/testzope/Products/OSA_system2/OSAS_helpers.pysgetTexts&&&&&&c
1.8       dwinter     5: Cs   g}t&iii|&&}y t|id&&di&}Wn
&&&d}n&Xy t|id&di&}Wn
&&&d}n&Xy t|id&di&}Wn
&&&d}n&Xy t|id&di&} Wn
&&&d}    n&Xy t|id&di&}Wn
&&&d}n&X|d   jo&d
                      6: |d}n.&|djo&d
|d}n&d
                      7: |d}|d|d|d}|d| d}yt|id&did&d}|iid&o &|d|idid}n&|d}|t|i&}Wn&&&n&X|SdS(s'get index.meta and translate it to HTMLsnameisNOT_DEFINED!!!screatorsarchive-creation-datesdescriptionscontent-typessscanned documents<h3>Document: s</h3>sfolders<h3>Folder: s<p><i>created by: s at: s</i></p>s<h4>Description</h4><p>s</p>smetasbibstypes
1.3       dwinter     8: <h4>Info (s)</h4>s
<h4>Info</h4>N(shtmlsxmlsdomsminidomsparseStringsxmlInfosgetTextsgetElementsByTagNames
1.1       dwinter     9: childNodessnamescreators
creation_datesdescriptionstypesbibs
1.3       dwinter    10: attributesshas_keysvaluesgetBib(
1.9     ! dwinter    11: spathsxmlInfosnamesdomsbibscreators
creation_dateshtmlstypesdescription((s8/usr/local/testzope/Products/OSA_system2/OSAS_helpers.pysgetMetaInfoFromXMLsN&&&& &&
1.8       dwinter    12: && &&
                     13: & &&
                     14: & &&
                     15: & &&
                     16: &
&&
&&&& && 
                     17: &&cCsXg}  t&ii|&d&&o&|i|&&Sn&&t&id|&d&d}|i}t
                     18: iii
|&}y t|id&di&}Wn
&&&d}n&Xy t|id&di&}Wn
&&&d}n&Xy t|id&di&}Wn
&&&d}n&Xy t|id   &di&}Wn
&&&d}n&Xy t|id
                     19: &di&}Wn
&&&d}n&X|djo&d
|d}    n.&|djo&d|d}  n&d
|d}   |  d|d|d}  |  d|d}  yt|id&did&d}
                     20: |
                     21: iid&o &| d|
                     22: idid}  n&|  d}  |  t|
                     23: i&}  Wn&&&n&X|   SdS(s'get index.meta and translate it to HTMLs/index.metascat s&rsnameisNOT_DEFINED!!!screatorsarchive-creation-datesdescriptionscontent-typessscanned documents<h3>Document: s</h3>sfolders<h3>Folder: s<p><i>created by: s at: s</i></p>s<h4>Description</h4><p>s</p>smetasbibstypes
1.3       dwinter    24: <h4>Info (s)</h4>s
<h4>Info</h4>N(shtmlsosspathsexistssselfsgetMetaInfoFromIndexMetaspopens&fsreadslinessxmlsdomsminidomsparseStringsgetTextsgetElementsByTagNames
1.2       dwinter    25: childNodessnamescreators
creation_datesdescriptionstypesbibs
1.9     ! dwinter    26: attributesshas_keysvaluesgetBib(sselfspathsnames&fstypesdomsliness
creation_datescreatorshtmlsbibsdescription((s8/usr/local/testzope/Products/OSA_system2/OSAS_helpers.pysgetMetaFileHsV&&&&&&&& &&
1.8       dwinter    27: && &&
                     28: & &&
                     29: & &&
                     30: & &&
                     31: &
&&
&&&& && 
                     32: &&c&Csfd&}xQ|D]I}&|&i|&ijo0&|dt|&i&dt|&i&d}q
&q
W|dSdS(s# translate bibliographical entries s<table border='0'>s<tr><td valign='right'>s:</td><td> s
1.1       dwinter    33: </td></tr>s</table>N(   srcsnodelistsnodesnodeTypesELEMENT_NODEsstrsnodeNamesgetTexts
1.9     ! dwinter    34: childNodes(snodelistsnodesrc((s8/usr/local/testzope/Products/OSA_system2/OSAS_helpers.pysgetBibs&&&4cCsh}yt&iiitii|&d&d&}xY|id&D]H}t
1.8       dwinter    35: |id&d&i&}&t
                     36: |id&d&i&}|&||<qBW|SWn&&&|Sn&XdS(s&gibt Eigenschaften der directorys gemaess Index.metas file in path aus
1.1       dwinter    37:     @param path: Pfad in dem das index.meta liegt
                     38:     @param propery: Property die ausgegebenwerden soll
                     39:     @return: Hash mit key  name des Directories and Value von property, None if error.
                     40:     is/index.metasdirscontent-typesnameN(sretsxmlsdomsminidomsparsesosspathssplitsgetElementsByTagNamesnodesgetTexts
1.9     ! dwinter    41: childNodesspropertysdirName(spathspropertysnodesdirNamesdomsret((s8/usr/local/testzope/Products/OSA_system2/OSAS_helpers.pysgetPropertyOfDirss&&&)&&&&&cCsRtt&ii|&d&|&it&ii|&dt|jo&dSn&d&SdS(sgibt 1 zurck falls path hat propertyName und properName=propertyValue
1.1       dwinter    42:     @param propertyName:Property von path in index.meta des parent folders von path
                     43:     @param propertyValue:Wert der Property
                     44:     @param path: Pfad der getestet werden soll
1.9     ! dwinter    45:     ii&N(sgetPropertyOfDirssosspathssplitspropertyNamesgetsNones
propertyValue(spathspropertyNames
propertyValue((s8/usr/local/testzope/Products/OSA_system2/OSAS_helpers.pysdirHasPropertys&B&c&Cst|d&do&dSn&&ywti|&}dddddd    g}d
        !            46: }x?|D]7}&ti&i|&&di  }||jo&dSqR&qRWdSWn&&&dSn&XdS(
sAcheck if folder contains images without metadata or with metadatascontent-typesimagesi&s.gifs.jpgs.jpegs.pngs.tiffs.tifsiN(sdirHasPropertyspathsosslistdirsdirs
imagesuffixessrets&assplitextslowerssuffix(spaths&assuffixsrets
imagesuffixessdir((s8/usr/local/testzope/Products/OSA_system2/OSAS_helpers.pys
isImageFolders&&&&&
&&c&&Csti&i|&d&ddjp&ti&i|&d&tjo&tSnq&t|&o&dSn\&ti&i|&d&djo&dSn7&ti&i|&o&dSn&ti&i|&o&dSn&&d  S(
1.1       dwinter    47: sHchecke filetype
                     48:     nicht erkannte type auf werden auf none gesetzt
                     49:     i&is&.sOSAS_imageFolders
1.9     ! dwinter    50: index.metasOSAS_metaDataFilesOSAS_dirs  OSAS_fileN(  sosspathssplitsobjectsOSASExcludedFilessNones
isImageFoldersisdirsisfile(&sobject((s8/usr/local/testzope/Products/OSA_system2/OSAS_helpers.pyscheckOSASFileTypes&>&&
&&&&&&&c&&Cs&t|&tjo&|g&Sn&|Sd&S(shEinzelfeld in Liste umwandeln
1.1       dwinter    51:     @param fields: String oder Array
                     52:     @return: gibt liste zurueck
                     53: 
                     54:     N(stypesfieldss
1.9     ! dwinter    55: StringType(&sfields((s8/usr/local/testzope/Products/OSA_system2/OSAS_helpers.pystoLists&&cCstd&t&SdS(sgives formatted local dates%d.%m.%YN(sstrftimes    localtime(((s8/usr/local/testzope/Products/OSA_system2/OSAS_helpers.pys   localDates&&(sos.pathsosstypessxml.dom.minidomsxmlszLOGsOSASObjectTypessOSASExcludedFilessgetTextsgetMetaInfoFromXMLsgetMetaFilesgetBibsgetPropertyOfDirssdirHasPropertys
isImageFolderscheckOSASFileTypestoLists   localDate(sxmlsOSASObjectTypesscheckOSASFileTypesOSASExcludedFiless  localDatesgetBibsgetTexts
isImageFoldersgetMetaInfoFromXMLsgetPropertyOfDirssdirHasPropertyszLOGsosstoListsgetMetaFile((s8/usr/local/testzope/Products/OSA_system2/OSAS_helpers.pys&?s  && &   &      5   9                  

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>