Mercurial > hg > MetaDataProvider
changeset 25:64b703d1b8a4
Merge with d036de7fd78d45d9558dfccb88042cbec83d4b5e
author | casties |
---|---|
date | Fri, 27 Jul 2012 12:53:51 +0200 |
parents | 5ed16f971297 (diff) d036de7fd78d (current diff) |
children | a19575be96e8 |
files | MetaDataFolder.py |
diffstat | 4 files changed, 28 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/MetaDataFolder.py Fri Jul 27 12:46:00 2012 +0200 +++ b/MetaDataFolder.py Fri Jul 27 12:53:51 2012 +0200 @@ -109,9 +109,14 @@ else: url = os.path.join(self.metaDataServerUrl%path,'index.meta') - #logging.debug("get Metadata: %s"%url) - md = getHttpData(url) - return md + try: + md = getHttpData(url) + return md + + except: + logging.error("getMDFromPathOrUrl: unable to get data!") + + return None def getDomFromPathOrUrl(self, path): """returns DOM of metadata file at given path"""
--- a/MetaDataMapping.py Fri Jul 27 12:46:00 2012 +0200 +++ b/MetaDataMapping.py Fri Jul 27 12:53:51 2012 +0200 @@ -24,10 +24,10 @@ """Metadata mapping object representing a fixed set of sub-elements.""" meta_type="MetadataMapping" - manage_options = SimpleItem.manage_options+( - {'label':'Main Config','action':'manage_changeMetaDataMappingForm'}, + manage_options = ( + {'label':'Configuration','action':'manage_changeMetaDataMappingForm'}, {'label':'Field order','action':'manage_changeFieldOrderForm'}, - ) + ) + SimpleItem.manage_options fields = {} """dict containing element descriptions"""
--- a/SrvTxtUtils.py Fri Jul 27 12:46:00 2012 +0200 +++ b/SrvTxtUtils.py Fri Jul 27 12:53:51 2012 +0200 @@ -1,12 +1,17 @@ """Utility methods for handling XML, reading HTTP, etc""" +from App.ImageFile import ImageFile +from App.Common import rfc1123_date + import sys +import os +import stat import urllib import urllib2 import logging -srvTxtUtilsVersion = "1.2" +srvTxtUtilsVersion = "1.3" def getInt(number, default=0): """returns always an int (0 in case of problems)""" @@ -92,3 +97,13 @@ raise IOError("ERROR fetching HTTP data from %s: %s"%(url,errmsg)) #return None + +def refreshingImageFileIndexHtml(self, REQUEST, RESPONSE): + """index_html method for App.ImageFile that updates the file info for each request.""" + stat_info = os.stat(self.path) + self.size = stat_info[stat.ST_SIZE] + self.lmt = float(stat_info[stat.ST_MTIME]) or time.time() + self.lmh = rfc1123_date(self.lmt) + # call original method + return ImageFile.index_html(self, REQUEST, RESPONSE) +