--- OSA_system2/OSAS_helpers.py 2005/03/07 19:33:42 1.8 +++ OSA_system2/OSAS_helpers.py 2007/01/31 14:30:29 1.11 @@ -2,7 +2,14 @@ import os.path from types import * import xml.dom.minidom -import zLOG +import logging + +#ersetzt logging +def logger(txt,method,txt2): + """logging""" + logging.info(txt+ txt2) + + OSASObjectTypes=['OSAS_metaDataFile','OSAS_dir','Osas_file','OSAS_imageFolder','OSAS_dir_archive','OSAS_file_archive','OSAS_videoFolder','OSAS_videoFile','OSAS_videoFolder'] OSASDirObjects=['OSAS_dir','OSAS_imageFolder',] @@ -13,7 +20,7 @@ def getText(nodelist): """gibt text aus nodelist""" rc = "" for node in nodelist: - if node.nodeType == node.TEXT_NODE: + if node.nodeType == node.TEXT_NODE: rc = rc + node.data return rc @@ -77,10 +84,10 @@ def getBib(nodelist): for node in nodelist: - if node.nodeType == node.ELEMENT_NODE: - """nothing""" + if node.nodeType == node.ELEMENT_NODE: + """nothing""" - rc = rc+""+str(node.nodeName)+": "+getText(node.childNodes)+"" + rc = rc+""+str(node.nodeName)+": "+getText(node.childNodes)+"" #print rc return rc+"" @@ -134,7 +141,7 @@ def isImageFolder(path,indexMeta): def isVideoFolder(path,indexMeta): """check if folder contains images without metadata or with metadata""" # metadaten ergeben imagefolder - print "test video",path + if dirHasProperty(path,indexMeta,'media-type','video'): return 1 @@ -153,7 +160,7 @@ def isImageFolderGuess(path): for a in dir: suffix=os.path.splitext(a)[1].lower() - + if suffix in imagesuffixes: return 1 @@ -191,6 +198,6 @@ def toList(fields): def localDate(): """gives formatted local date""" - return strftime("%d.%m.%Y",localtime()) + return strftime("%d.%m.%Y",localtime())