Ignore:
Timestamp:
31/07/12 15:35:45 (8 years ago)
Author:
mnagni
Message:

Implemented adapters for TM_Instant, TM_Period and partially for CEDA_Observation

Added a Sphinx documentation folder

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/tests/moles2gui/creationFactory.py

    r8476 r8477  
    3333from libs.migration.processor.commons import createCI_OnlineResource,\ 
    3434    createCI_Address, createCI_Telephone, createCI_Contact,\ 
    35     createMO_Organization, createMO_Individual, createMO_ResponsiblePartyInfo 
     35    createMO_Organization, createMO_Individual, createMO_ResponsiblePartyInfo,\ 
     36    isoDateTimeStringToTimeDate, createDateTime, createTM_Position,\ 
     37    createTM_Instant, fromDateStringToPhenomenonTime 
    3638from MolesManager.codelist import getCLValue, MM_RoleValue 
     39from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation 
    3740 
    3841def assembleMO_Individual(name = 'CedaTest', iid = 1): 
     
    6063    rp.id =iid 
    6164    return rp 
     65 
     66def assembleTM_Instant(timestring = '2012-01-01T01:01:01Z'): 
     67    """ 
     68    Returns a TM_Instant instance 
     69         
     70    **Parameters** 
     71        * timestring: a time string formatted as '%Y-%m-%dT%H:%M:%SZ' 
     72    """ 
     73    py_datetime = isoDateTimeStringToTimeDate(timestring) 
     74    date_time = createDateTime(py_datetime)     
     75    tm_position = createTM_Position(dateTime8601 = date_time) 
     76    return createTM_Instant(tm_position) 
     77 
     78def assembleObservation(phenomenonTime = '2002-07-22/2011-08-06'): 
     79    ceda_observation = CEDA_Observation() 
     80    ceda_observation.relatedParty = assembleMO_ResponsiblePartyInfo() 
     81    ceda_observation.resultTime = assembleTM_Instant() 
     82    ceda_observation.phenomenonTime = fromDateStringToPhenomenonTime(phenomenonTime) 
     83    return ceda_observation 
Note: See TracChangeset for help on using the changeset viewer.