Changeset 292


Ignore:
Timestamp:
06/02/15 11:58:22 (6 years ago)
Author:
mjuckes
Message:

First step to config driven specifications

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CCCC/trunk/ceda_cc/config_c4.py

    r287 r292  
    117117    self.dir = dir 
    118118 
     119  def driver(self,tt): 
     120    if tt[0] == "simpleList": 
     121      tx = tt + (None,None,None,None) 
     122      return self.getSimpleList( tx[1],bit=tx[2],omt=tx[3],options=tx[4] ) 
     123    else: 
     124      print 'readVocab.driver: option %s not recgnised' % tt[0] 
     125 
    119126  def getSimpleList(self,file,bit=None,omt=None,options=None): 
    120127    ii = open('%s/%s/%s' % (CC_CONFIG_DIR, self.dir,file) ) 
     
    124131      ee = {} 
    125132 
    126     
    127133    for l in ii.readlines(): 
    128134      if l[0] != '#': 
     
    139145          else: 
    140146            oo.append(string.split(ll)[bit]) 
     147 
    141148    if options == 'returnMappings': 
    142149      return oo, ee 
     
    176183    elif project == 'SPECS': 
    177184      lrdr = readVocab( 'specs_vocabs/') 
    178       self.requiredGlobalAttributes = lrdr.getSimpleList( 'globalAts.txt' ) 
     185      ##self.requiredGlobalAttributes = lrdr.getSimpleList( 'globalAts.txt' ) 
     186      self.requiredGlobalAttributes = lrdr.driver( ('simpleList', 'globalAts.txt' ) ) 
    179187      self.exptFamilies = lrdr.getSimpleList( 'exptFamily.txt', bit=0 ) 
    180188      self.controlledGlobalAttributes = [ 'project_id','experiment_id', 'frequency','Conventions','modeling_realm', \ 
Note: See TracChangeset for help on using the changeset viewer.