Changeset 8406


Ignore:
Timestamp:
26/06/12 14:02:15 (7 years ago)
Author:
mnagni
Message:

# 22505: Use the CedaMoles? python package
removed the ceda_moles folders and verified the imports

Location:
mauRepo/HPFos/trunk
Files:
1 added
3 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/HPFos/trunk/resources/requirements.txt

    r8383 r8406  
    88# to your pip install  
    99ceda-markup==0.0.1 
     10ceda-moles-model==0.1.0 
    1011 
    1112#This package should be available in the machine where CedaManager will be deployed 
  • mauRepo/HPFos/trunk/src/HPFos/moles3epb.py

    r8354 r8406  
    4242from sqlalchemy.orm import mapper 
    4343from ea_model.moles3_4.utilities.mo_responsiblepartyinfo import MO_ResponsiblePartyInfo 
    44 from ea_model.moles3_4.utilities.mo_rolevalue import MO_RoleValue 
    4544from sqlalchemy.orm.collections import InstrumentedList 
    4645from ceda_guid import CedaGUID 
     
    242241        return self._session.query(CEDA_ObservationCollection, CEDA_Observation).filter(CEDA_ObservationCollection.id==obs_coll_id).all() 
    243242 
    244     def observationAuthor(self, obs_id): 
    245         """ 
    246             Lists the CEDA_Observation author. 
    247             @param obs_id: the CEDA_Observation id             
    248             @return: True if the collection contains the given observation, False otherwise   
    249         """ 
    250         ret = self._session.query(MO_ResponsiblePartyInfo).join(MO_Observation). \ 
    251             filter(MO_ResponsiblePartyInfo.role == MO_RoleValue.cl_author). \ 
    252             filter(MO_Observation.id == obs_id)        
    253         return ret 
    254243 
    255244    def extractObservationByTitleKeywords(self, keywords): 
  • mauRepo/HPFos/trunk/src/HPFos/osImpl/myimpl.py

    r8383 r8406  
    4646from ceda_markup.georss.georss import Where 
    4747from ceda_markup.template.html import OSHTMLResponse 
    48 from ceda_markup.opensearch.osquery import OSQuery 
     48from ceda_markup.opensearch.osquery import OSQuery, URL_INDEX_OFFSET_DEFAULT,\ 
     49    URL_PAGE_OFFSET_DEFAULT 
    4950from ceda_markup.opensearch.osParam import OSParam 
    5051 
     
    239240        super(MyOSQuery, self).__init__(params) 
    240241 
    241     def _packResult(self, results, **kwargs): 
    242         subresults = [] 
    243  
     242 
     243    def _filterResults(self, results, **kwargs): 
    244244        step = calculateStep(**kwargs) 
    245245 
     
    264264                lastResult = len(results) 
    265265 
    266         for result in results[firstResult - 1:lastResult]: 
     266        return results[firstResult - 1:lastResult] 
     267 
     268    def _packResult(self, results, **kwargs): 
     269 
     270        filtered = self._filterResults(results, **kwargs) 
     271 
     272        subresults = [] 
     273        for result in filtered: 
    267274            result_guid = kwargs['moles3EPB'].retrieveGUIDFromInstance(result) 
    268275            item = Subresult(result_guid.id, "title", datetime.now().isoformat()) 
     
    270277         
    271278        return Result(len(results), subresult = subresults) 
    272          
     279 
    273280         
    274281    def doSearch(self, **kwargs): 
     
    290297        results = kwargs['moles3EPB'].getObservationCollections(bbox = ibbox) 
    291298 
    292                                    
    293                  
     299 
    294300         
    295301        return self._packResult(results, **kwargs) 
  • mauRepo/HPFos/trunk/src/HPFos/settings.py

    r8349 r8406  
    169169#MOLES3_DB_CONNECTION = 'PG_MOLES3_DB_CONNECTION' 
    170170#MOLES3_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3' 
    171 MOLES3_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3_test1' 
    172 from sqlTables import doTables as doMoles 
     171MOLES3_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3_dev1' 
     172from ea_model.sqlTables import doTables as doMoles 
    173173MOLES3_DB_SCRIPT = doMoles 
  • mauRepo/HPFos/trunk/src/HPFos/view/view.py

    r8360 r8406  
    7878        params[RESULT] = result_guid                 
    7979     
    80     response = os_engine.doSearch(hostURL, iformat, params_values = params, moles3EPB = request.moles3EPB) 
     80    response = os_engine.doSearch(hostURL, iformat, params_values = params, moles3EPB = request.moles3EPB, \ 
     81                                  startIndex = 1, startPage = 2, count = 0) 
    8182    context = {} 
    8283    context['response'] = mark_safe(response) 
  • mauRepo/HPFos/trunk/src/tests/moles3epbtests.py

    r8354 r8406  
    3737from tests.testconfig import getMoles3EPB, closeEPB 
    3838from ea_model.ceda_metadatamodel.ceda_observationcollection.ceda_observationcollection import CEDA_ObservationCollection 
    39 from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation 
    4039 
    4140class Moles3EPBTest(TestCase): 
  • mauRepo/HPFos/trunk/src/tests/testconfig.py

    r8354 r8406  
    3737POSTGIS_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3' 
    3838 
    39 from sqlTables import doTables as doMoles, attachEvents 
     39from ea_model.sqlTables import doTables as doMoles, attachEvents 
    4040MOLES3_DB_SCRIPT = doMoles 
    4141EVENTS_DB = attachEvents 
Note: See TracChangeset for help on using the changeset viewer.