Ignore:
Timestamp:
19/10/06 12:40:50 (13 years ago)
Author:
domlowe
Message:

ongoing changes to csml2moles.py - convenient time to commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/csml2MolesStuff/molesWriter.py

    r1606 r1608  
    6363 
    6464    def _createClasses(self): 
    65         self.dataModelID=self._create_a_class('dataModelID', molesElement,) 
    66         self.dgDataGranule=self._create_a_class('dgDataGranule', molesElement) 
    67         self.dgDataEntity=self._create_a_class('dgDataGranule', molesElement) 
    68         self.dgMetadataRecord=self._create_a_class('dgMetadataRecord', molesElement) 
    69         self.dgMetadataID=self._create_a_class('dgMetadataID', molesElement) 
     65        #if you want more classes just add their names to this list 
     66        classList=[\ 
     67        'dataModelID', \ 
     68        'dgDataGranule', \ 
     69        'dgDataEntity', \ 
     70        'dgMetadataRecord', \ 
     71        'dgMetadataID', \ 
     72        ] 
     73 
     74        for className in classList: 
     75            newClass=self._create_a_class(className, molesElement) 
     76            setattr(self,className,newClass) 
    7077 
    7178def main(): 
     
    7481    M._createClasses() 
    7582     
    76     #create your moles doc by setting attributes. 
     83    '''create your moles doc by setting attributes of "M.className" 
     84    the classNames used must be declared in molesWriter.MolesDoc.classList''' 
    7785    dgMID=M.dgMetadataID(schemeIdentifier='NDG-B0', repositoryIdentifier='badc.nerc.ac.uk', localIdentifier='COAPEC_HadCM3_500Yr') 
    7886    dmID= M.dataModelID(schemeIdentifier='NDG-A0', repositoryIdentifier='badc.nerc.ac.uk', localIdentifier='COAPEC_500YrRun_wholerun_annual_atmos') 
Note: See TracChangeset for help on using the changeset viewer.