- Timestamp:
- 07/09/12 15:30:32 (7 years ago)
- Location:
- mauRepo/HPFos/trunk/hpfos/HPFos
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
mauRepo/HPFos/trunk/hpfos/HPFos/moles3epb.py
r8557 r8565 93 93 94 94 def getObservationCollections(self, bbox = None, keywords = '*', 95 start = None, end= None):95 start = None, stop = None): 96 96 """ 97 97 Returns the stored CEDA_ObservationCollection … … 114 114 115 115 res = collections.all() 116 if bbox is None and start is None and endis None:116 if bbox is None and start is None and stop is None: 117 117 return res 118 118 119 119 res = self._filter_bbox(collections, bbox); 120 res = self._filter_time(res, start, end)120 res = self._filter_time(res, start, stop) 121 121 return res 122 122 … … 142 142 #is a TM_Instant? 143 143 if hasattr(phenomenon, 'ceda_timestamp'): 144 #is a TM_Period? 145 if hasattr(phenomenon, 'start') and hasattr(phenomenon, 'end'): 146 if start is not None \ 147 and end is None \ 148 and start < phenomenon.start.ceda_timestamp: 149 res.append(collection) 150 break 151 if start is not None \ 152 and end is not None \ 153 and start < phenomenon.start.ceda_timestamp \ 154 and end > phenomenon.end.ceda_timestamp: 155 res.append(collection) 156 break 157 144 158 if start is not None and start < phenomenon.ceda_timestamp: 145 159 res.append(collection) 146 160 break 147 #is a TM_Period? 148 if hasattr(phenomenon, 'start') and hasattr(phenomenon, 'end'): 149 if start is not None \ 150 and end is None \ 151 and start < phenomenon.start.ceda_timestamp: 152 res.append(collection) 153 break 154 if start is not None \ 155 and end is not None \ 156 and start < phenomenon.start.ceda_timestamp \ 157 and end > phenomenon.end.ceda_timestamp: 158 res.append(collection) 159 break 161 160 162 return res 161 163 -
mauRepo/HPFos/trunk/hpfos/HPFos/osImpl/commons.py
r8548 r8565 47 47 def isoDateStringToDatetime(datestring): 48 48 try: 49 return _isoDateStringToTimeDate(datestring)49 return isoDateStringToTimeDate(datestring) 50 50 except: 51 51 try: … … 54 54 pass 55 55 56 def _isoDateStringToTimeDate(datestring):56 def isoDateStringToTimeDate(datestring): 57 57 ''' 58 58 Return a datatime.datatime instance. -
mauRepo/HPFos/trunk/hpfos/HPFos/osImpl/myimpl.py
r8557 r8565 60 60 from ceda_markup.atom.atom import ATOM_NAMESPACE 61 61 from hpfos.HPFos.osImpl.commons import get_document, get_xml_document, \ 62 from_pt_to_string, tm_InstantToDatetime 62 from_pt_to_string, tm_InstantToDatetime, isoDateStringToTimeDate 63 63 from ceda_markup.opensearch.os_request import OS_NAMESPACE 64 64 from xml.etree.ElementTree import _ElementInterface … … 74 74 DUMMY_GUID = 'dummy_guid' 75 75 76 FATCAT_HOST = 'ci dev1.jc.rl.ac.uk'76 FATCAT_HOST = 'citest1.jc.rl.ac.uk' 77 77 FATCAT_ROOT_PATH = 'fatcatOS' 78 78 PROXY_URL = 'http://wwwcache.rl.ac.uk:8080' … … 460 460 return self._extractFatcatEntities(context[GUID]) 461 461 462 start = None 463 stop = None 464 if context['start'] is not None: 465 start = isoDateStringToTimeDate(context['start']) 466 if context['stop'] is not None: 467 stop = isoDateStringToTimeDate(context['stop']) 468 462 469 if not context.has_key(GUID) or context[GUID] is None: 463 return context['moles3EPB'].getObservationCollections(bbox = ibbox, 464 keywords = context['q'], 465 start = context['start'], 466 end = context['stop']) 470 return context['moles3EPB'].\ 471 getObservationCollections(bbox = ibbox, 472 keywords = context['q'], 473 start = start, 474 stop = stop) 467 475 468 476 obj = context['moles3EPB'].getInstanceFromGUID(context[GUID])
Note: See TracChangeset
for help on using the changeset viewer.