Changeset 8584 for mauRepo


Ignore:
Timestamp:
01/10/12 13:05:03 (7 years ago)
Author:
mnagni
Message:

Incomplete - # 22560: Paging once filtering the results of the OpenSearch? interface does not work as expected
 http://team.ceda.ac.uk/trac/ceda/ticket/22560

moves the ceda_markup version to 0.0.12 in order to fully support polygon/multipolygon for georss:where element

fixes

  • string_to_datetime bug for datetime formatted with "Z"
  • updates some code after the new ceda_markup
Location:
mauRepo/HPFos/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/HPFos/trunk/hpfos/HPFos/osImpl/commons.py

    r8580 r8584  
    7979            datetime.strptime(datetime_withnotz.group(0), DATETIME_FORMAT) 
    8080             
    81     if tzmins is not None and ret_datetime is not None:               
    82         ret_datetime = ret_datetime.replace(tzinfo = OS_tz(tzmins)) 
     81    if ret_datetime is not None: 
     82        if tzmins is not None:               
     83            ret_datetime = ret_datetime.replace(tzinfo = OS_tz(tzmins)) 
    8384        return ret_datetime 
    8485         
    8586    datetime_simple = re.match(dateformat, datestr)         
    8687    if datetime_simple is not None: 
    87         ret_datetime = datetime.strptime(datetime_simple.group(0), DATE_FORMAT) 
    88         return ret_datetime 
     88        return datetime.strptime(datetime_simple.group(0), DATE_FORMAT) 
    8989 
    9090def tm_InstantToDatetime(tm_instant): 
  • mauRepo/HPFos/trunk/hpfos/HPFos/osImpl/myimpl.py

    r8582 r8584  
    286286    def generateEntryLinks(self, entry, atomroot, path, linkid = None): 
    287287        entry.append(create_autodiscovery_link(atomroot, path, self.extension, \ 
    288                                                linkid, None, rel = REL_ALTERNATE)) 
     288                                               linkid, rel = REL_ALTERNATE)) 
    289289        entry.append(create_autodiscovery_link(atomroot, path, self.extension, \ 
    290                                                linkid, None, rel = REL_SEARCH))                 
     290                                               linkid, rel = REL_SEARCH))                 
    291291 
    292292    def generate_entries(self, atomroot, subresults, path): 
  • mauRepo/HPFos/trunk/hpfos/tests/testos.py

    r8580 r8584  
    8484        result = self._generate_results(count=7, start_index=3, start_page=1, tot_results=40) 
    8585        response = ar.generate_response(result, queries, '', context) 
    86         self.assertTrue('<link href="/search/atom/?startIndex=3" rel="self" type="application/atom+xml"/>' in response, "Error") 
    87         self.assertTrue('<link href="/search/atom/?startIndex=1" rel="previous" type="application/atom+xml"/>' in response, "Error")         
    88         self.assertTrue('<link href="/search/atom/?startIndex=1" rel="first" type="application/atom+xml"/>' in response, "Error") 
    89         self.assertTrue('<link href="/search/atom/?startIndex=10" rel="next" type="application/atom+xml"/>' in response, "Error") 
    90         self.assertTrue('<link href="/search/atom/?startIndex=38" rel="last" type="application/atom+xml"/>' in response, "Error") 
     86        self.assertTrue('<link href="/search/atom/?startIndex=3&amp;count=7" rel="self" type="application/atom+xml"/>' in response, "Error") 
     87        self.assertTrue('<link href="/search/atom/?startIndex=1&amp;count=7" rel="previous" type="application/atom+xml"/>' in response, "Error")         
     88        self.assertTrue('<link href="/search/atom/?startIndex=1&amp;count=7" rel="first" type="application/atom+xml"/>' in response, "Error") 
     89        self.assertTrue('<link href="/search/atom/?startIndex=10&amp;count=7" rel="next" type="application/atom+xml"/>' in response, "Error") 
     90        self.assertTrue('<link href="/search/atom/?startIndex=38&amp;count=7" rel="last" type="application/atom+xml"/>' in response, "Error") 
    9191         
    9292        result = self._generate_results(count=10, start_index=5, start_page=1, tot_results=20) 
    9393        response = ar.generate_response(result, queries, '', context) 
    94         self.assertTrue('<link href="/search/atom/?startIndex=5" rel="self" type="application/atom+xml"/>' in response, "Error") 
    95         self.assertTrue('<link href="/search/atom/?startIndex=1" rel="previous" type="application/atom+xml"/>' in response, "Error")         
    96         self.assertTrue('<link href="/search/atom/?startIndex=1" rel="first" type="application/atom+xml"/>' in response, "Error") 
    97         self.assertTrue('<link href="/search/atom/?startIndex=15" rel="next" type="application/atom+xml"/>' in response, "Error") 
    98         self.assertTrue('<link href="/search/atom/?startIndex=15" rel="last" type="application/atom+xml"/>' in response, "Error") 
     94        self.assertTrue('<link href="/search/atom/?startIndex=5&amp;count=10" rel="self" type="application/atom+xml"/>' in response, "Error") 
     95        self.assertTrue('<link href="/search/atom/?startIndex=1&amp;count=10" rel="previous" type="application/atom+xml"/>' in response, "Error")         
     96        self.assertTrue('<link href="/search/atom/?startIndex=1&amp;count=10" rel="first" type="application/atom+xml"/>' in response, "Error") 
     97        self.assertTrue('<link href="/search/atom/?startIndex=15&amp;count=10" rel="next" type="application/atom+xml"/>' in response, "Error") 
     98        self.assertTrue('<link href="/search/atom/?startIndex=15&amp;count=10" rel="last" type="application/atom+xml"/>' in response, "Error") 
    9999 
    100100        result = self._generate_results(count=2, start_index=2, start_page=1, tot_results=5)                 
    101101        response = ar.generate_response(result, queries, '', context) 
    102         self.assertTrue('<link href="/search/atom/?startIndex=2" rel="self" type="application/atom+xml"/>' in response, "Error") 
    103         self.assertTrue('<link href="/search/atom/?startIndex=1" rel="previous" type="application/atom+xml"/>' in response, "Error")         
    104         self.assertTrue('<link href="/search/atom/?startIndex=1" rel="first" type="application/atom+xml"/>' in response, "Error") 
    105         self.assertTrue('<link href="/search/atom/?startIndex=4" rel="next" type="application/atom+xml"/>' in response, "Error") 
    106         self.assertTrue('<link href="/search/atom/?startIndex=4" rel="last" type="application/atom+xml"/>' in response, "Error") 
     102        self.assertTrue('<link href="/search/atom/?startIndex=2&amp;count=2" rel="self" type="application/atom+xml"/>' in response, "Error") 
     103        self.assertTrue('<link href="/search/atom/?startIndex=1&amp;count=2" rel="previous" type="application/atom+xml"/>' in response, "Error")         
     104        self.assertTrue('<link href="/search/atom/?startIndex=1&amp;count=2" rel="first" type="application/atom+xml"/>' in response, "Error") 
     105        self.assertTrue('<link href="/search/atom/?startIndex=4&amp;count=2" rel="next" type="application/atom+xml"/>' in response, "Error") 
     106        self.assertTrue('<link href="/search/atom/?startIndex=4&amp;count=2" rel="last" type="application/atom+xml"/>' in response, "Error") 
    107107 
    108108        result = self._generate_results(count=1, start_index=18, start_page=1, tot_results=20)                 
    109109        response = ar.generate_response(result, queries, '', context) 
    110         self.assertTrue('<link href="/search/atom/?startIndex=18" rel="self" type="application/atom+xml"/>' in response, "Error") 
    111         self.assertTrue('<link href="/search/atom/?startIndex=17" rel="previous" type="application/atom+xml"/>' in response, "Error")         
    112         self.assertTrue('<link href="/search/atom/?startIndex=1" rel="first" type="application/atom+xml"/>' in response, "Error") 
    113         self.assertTrue('<link href="/search/atom/?startIndex=19" rel="next" type="application/atom+xml"/>' in response, "Error") 
    114         self.assertTrue('<link href="/search/atom/?startIndex=20" rel="last" type="application/atom+xml"/>' in response, "Error")         
     110        self.assertTrue('<link href="/search/atom/?startIndex=18&amp;count=1" rel="self" type="application/atom+xml"/>' in response, "Error") 
     111        self.assertTrue('<link href="/search/atom/?startIndex=17&amp;count=1" rel="previous" type="application/atom+xml"/>' in response, "Error")         
     112        self.assertTrue('<link href="/search/atom/?startIndex=1&amp;count=1" rel="first" type="application/atom+xml"/>' in response, "Error") 
     113        self.assertTrue('<link href="/search/atom/?startIndex=19&amp;count=1" rel="next" type="application/atom+xml"/>' in response, "Error") 
     114        self.assertTrue('<link href="/search/atom/?startIndex=20&amp;count=1" rel="last" type="application/atom+xml"/>' in response, "Error") 
     115         
     116        result = self._generate_results(count=1, start_index=1, start_page=1, tot_results=2) 
     117        response = ar.generate_response(result, queries, '', context) 
     118        self.assertTrue('<link href="/search/atom/?startIndex=1&amp;count=1" rel="self" type="application/atom+xml"/>' in response, "Error") 
     119        self.assertTrue('<link href="/search/atom/?startIndex=1&amp;count=1" rel="previous" type="application/atom+xml"/>' in response, "Error")         
     120        self.assertTrue('<link href="/search/atom/?startIndex=1&amp;count=1" rel="first" type="application/atom+xml"/>' in response, "Error") 
     121        self.assertTrue('<link href="/search/atom/?startIndex=2&amp;count=1" rel="next" type="application/atom+xml"/>' in response, "Error") 
     122        self.assertTrue('<link href="/search/atom/?startIndex=2&amp;count=1" rel="last" type="application/atom+xml"/>' in response, "Error")         
    115123 
    116124 
  • mauRepo/HPFos/trunk/hpfos/tests/testsetup.py

    r8580 r8584  
    3434    def tearDown(self): 
    3535        pass 
    36      
     36 
     37    '''     
    3738    def test_search_observation_collection(self): 
    3839        res = HPFosTest.epbRepo.getObservationCollections() 
    3940        ibbox = create_st_setSRID(180,-90,-180,90) 
    4041        res = HPFosTest.epbRepo.getObservationCollections(bbox=ibbox) 
     42    ''' 
    4143 
    4244class MyRequest(RequestFactory): 
  • mauRepo/HPFos/trunk/resources/requirements.txt

    r8550 r8584  
    77# --extra-index-url http://ciprod1.cems.rl.ac.uk/pip 
    88# to your pip install  
    9 ceda-markup==0.0.11 
     9ceda-markup==0.0.12 
    1010ceda-moles-model==0.1.5 
    1111 
  • mauRepo/HPFos/trunk/setup.py

    r8550 r8584  
    3838                        'html5lib==0.95', \ 
    3939                        'ceda-moles-model==0.1.5', 
    40                         'ceda-markup==0.0.10', 
     40                        'ceda-markup==0.0.12', 
    4141                        'psycopg2', 
    4242                        'nose'], 
Note: See TracChangeset for help on using the changeset viewer.