# HG changeset patch # User casties # Date 1367836443 -7200 # Node ID f6a8055f6798bb81d089b2019714270f19abe8af # Parent 460c286c252ee4191f098b4cac3a6dc0bb2a2490 take first value from multiple occurrences of same tag. diff -r 460c286c252e -r f6a8055f6798 MetaData.py --- a/MetaData.py Mon Jan 07 18:45:34 2013 +0100 +++ b/MetaData.py Mon May 06 12:34:03 2013 +0200 @@ -1,6 +1,5 @@ from OFS.Folder import Folder from Products.PageTemplates.PageTemplateFile import PageTemplateFile -from Globals import package_home from AccessControl import ClassSecurityInfo import logging @@ -8,7 +7,7 @@ import xml.sax.saxutils from MetaDataMapping import MetaDataMapping -from SrvTxtUtils import getHttpData, getText +from SrvTxtUtils import getText def normalizeFieldName(bt, underscore=True): """returns normalised field type for looking up mappings""" @@ -145,8 +144,10 @@ # add multiple tags as list putAppend(data, key, val) else: - data[key] = val - + if key not in data: + # don't overwrite element data + data[key] = val + #logging.debug("_getDataFromDom: returns %s"%repr(data)) return data @@ -357,7 +358,7 @@ if remove is not None: path=path.replace(remove,'') if prefix is not None: - path=os.path.join(prefix,path) + path="%s/%s"%(prefix,path) if cut>0: splitted=path.split("/") diff -r 460c286c252e -r f6a8055f6798 version.txt --- a/version.txt Mon Jan 07 18:45:34 2013 +0100 +++ b/version.txt Mon May 06 12:34:03 2013 +0200 @@ -1,1 +1,1 @@ -2.0.3 \ No newline at end of file +2.0.4 \ No newline at end of file