File:  [Repository] / OSA_system2 / Attic / OSAS_helpers.pyc
Revision 1.5: download - view: text, annotated - select for diffs - revision graph
Thu Dec 23 15:45:56 2004 UTC (19 years, 5 months ago) by dwinter
Branches: MAIN
CVS tags: HEAD
minotrCVS: ----------------------------------------------------------------------

-
ҙAcsdkZdkTdkZdkZddddddgZdd	gZd
ZdZ	HdZ
d
ZdZdZ
dZdZdZdZdS(N(s*sOSAS_metaDataFilesOSAS_dirs	OSAS_filesOSAS_imageFoldersOSAS_dir_archivesOSAS_file_archivesTheVolumeSettingsFoldersTheFindByContentFoldercs[
d}x;|D]0}|i|ijo||i}nqW|SdS(sgibt text aus nodelistsN(srcsnodelistsnodesnodeTypes	TEXT_NODEsdata(snodelistsnodesrc((sK/usr/local/mpiwg/Zope_devel/lib/python/Products/OSA_system2/OSAS_helpers.pysgetTexts	
	c
sg}tiii|}y#t|iddi}Wnd}nXy#t|iddi}Wnd}nX!y#"t|iddi}Wn#$d}nX&y#'t|iddi}	Wn()d}	nX+y#,t|iddi}Wn-.d}nX/|d	jo0d
|d}n71|djo2d
|d}n4d
|d}6|d|d|d}7|d|	d}8y9|iddidd}:|iido#;|d|idid}n=|d}>|t|i}Wn
@AnXF|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
<h4>Info (s)</h4>s
<h4>Info</h4>N(shtmlsxmlsdomsminidomsparseStringsxmlInfosgetTextsgetElementsByTagNames
childNodessnamescreators
creation_datesdescriptionstypesbibs
attributesshas_keysvaluesgetBib(
spathsxmlInfosnamesdomsbibscreators
creation_dateshtmlstypesdescription((sK/usr/local/mpiwg/Zope_devel/lib/python/Products/OSA_system2/OSAS_helpers.pysgetMetaInfoFromXMLsN	#
#
#
#
#
##
csHIJg}Ktii|doL|i|SnOtid|dd}P|i}Qt
iii
|}
Ry#St|
iddi}WnTUd}nXVy#Wt|
iddi}WnXYd}nX[y#\t|
iddi}Wn]^d}nX`y#at|
id	di}Wnbcd}nXey#ft|
id
di}Wnghd}nXi|djojd
|d}n7k|djold|d}nnd
|d}p|d|d|d}q|d|d}rys|
iddidd}	t|	iido#u|d|	idid}nw|d}x|t|	i}Wn
z{nX|SdS(s'get index.meta and translate it to HTMLs/index.metascat srsnameisNOT_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
<h4>Info (s)</h4>s
<h4>Info</h4>N(shtmlsosspathsexistssselfsgetMetaInfoFromIndexMetaspopensfsreadslinessxmlsdomsminidomsparseStringsgetTextsgetElementsByTagNames
childNodessnamescreators
creation_datesdescriptionstypesbibs
attributesshas_keysvaluesgetBib(sselfspathsnamescreatorstypesfsliness
creation_dateshtmlsbibsdomsdescription((sK/usr/local/mpiwg/Zope_devel/lib/python/Products/OSA_system2/OSAS_helpers.pysgetMetaFileHsV	#
#
#
#
#
##
csd}x]|D]R}|i|ijo6|dt|idt|id}nqW|dSdS(s# translate bibliographical entries s<table border='0'>s<tr><td valign='right'>s:</td><td> s
</td></tr>s</table>N(	srcsnodelistsnodesnodeTypesELEMENT_NODEsstrsnodeNamesgetTexts
childNodes(snodelistsnodesrc((sK/usr/local/mpiwg/Zope_devel/lib/python/Products/OSA_system2/OSAS_helpers.pysgetBibs	
	7csh}ytiiitii|dd}xe|idD]Q}t
|iddi}t
|iddi}|||<qTW|SWn|SnXdS(sgibt Eigenschaften der directorys gemaess Index.metas file in path aus
    @param path: Pfad in dem das index.meta liegt
    @param propery: Property die ausgegebenwerden soll
    @return: Hash mit key  name des Directories and Value von property, None if error.
    is/index.metasdirscontent-typesnameN(sretsxmlsdomsminidomsparsesosspathssplitsgetElementsByTagNamesnodesgetTexts
childNodesspropertysdirName(spathspropertysnodesdirNamesdomsret((sK/usr/local/mpiwg/Zope_devel/lib/python/Products/OSA_system2/OSAS_helpers.pysgetPropertyOfDirss	,	csattii|d|itii|dt|jodSndSdS(sgibt 1 zurck falls path hat propertyName und properName=propertyValue
    @param propertyName:Property von path in index.meta des parent folders von path
    @param propertyValue:Wert der Property
    @param path: Pfad der getestet werden soll
    iiN(sgetPropertyOfDirssosspathssplitspropertyNamesgetsNones
propertyValue(spathspropertyNames
propertyValue((sK/usr/local/mpiwg/Zope_devel/lib/python/Products/OSA_system2/OSAS_helpers.pysdirHasPropertysEcst|ddodSnyti|}dddddd	g}d
}xK|D]@}tii|di	}||jodSnqmWdSWndSnXdS(
sAcheck if folder contains images without metadata or with metadatascontent-typesimagesis.gifs.jpgs.jpegs.pngs.tiffs.tifsiN(sdirHasPropertyspathsosslistdirsdirs
imagesuffixessretsassplitextslowerssuffix(spathsasdirs
imagesuffixessretssuffix((sK/usr/local/mpiwg/Zope_devel/lib/python/Products/OSA_system2/OSAS_helpers.pys
isImageFolders	
	cstii|dddjptii|dtjotSnt|odSnntii|ddjodSnCtii|odSn"tii|odSnd	S(
sHchecke filetype
    nicht erkannte type auf werden auf none gesetzt
    iis.sOSAS_imageFolders
index.metasOSAS_metaDataFilesOSAS_dirs	OSAS_fileN(	sosspathssplitsobjectsOSASExcludedFilessNones
isImageFoldersisdirsisfile(sobject((sK/usr/local/mpiwg/Zope_devel/lib/python/Products/OSA_system2/OSAS_helpers.pyscheckOSASFileTypesA cs5t|tjo|gSn|SdS(shEinzelfeld in Liste umwandeln
    @param fields: String oder Array
    @return: gibt liste zurueck

    N(stypesfieldss
StringType(sfields((sK/usr/local/mpiwg/Zope_devel/lib/python/Products/OSA_system2/OSAS_helpers.pystoListscstdtSdS(sgives formatted local dates%d.%m.%YN(sstrftimes	localtime(((sK/usr/local/mpiwg/Zope_devel/lib/python/Products/OSA_system2/OSAS_helpers.pys	localDates(sos.pathsosstypessxml.dom.minidomsxmlszLOGsOSASObjectTypessOSASExcludedFilessgetTextsgetMetaInfoFromXMLsgetMetaFilesgetBibsgetPropertyOfDirssdirHasPropertys
isImageFolderscheckOSASFileTypestoLists	localDate(sxmlsOSASObjectTypesscheckOSASFileTypesOSASExcludedFiless	localDatesgetBibsgetTexts
isImageFoldersgetMetaInfoFromXMLsgetPropertyOfDirssdirHasPropertyszLOGsosstoListsgetMetaFile((sK/usr/local/mpiwg/Zope_devel/lib/python/Products/OSA_system2/OSAS_helpers.pys?s
59

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