Ignore:
Timestamp:
22/06/16 16:17:43 (4 years ago)
Author:
mjuckes
Message:

01.beta.30

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreq/trunk/dreqPy/simpleCheck.py

    r594 r683  
    11from __init__ import DOC_DIR 
    2 import string, os, sys 
     2import string, os, sys, collections 
    33 
    44try: 
     
    7979  def _ch02_importSample(self): 
    8080    import dreq 
    81     self.dq = dreq.loadDreq( dreqXML=self.sampleXml,configdoc=self.defnXml ) 
     81    self.dq = dreq.loadDreq( manifest='out/dreqManifest.txt' ) 
    8282    print ( 'Dreq sample load checked' ) 
    8383    self.ok = True 
     
    8686    nn = 0 
    8787    import dreq 
    88     self.dq = dreq.loadDreq( ) 
     88    self.dq = dreq.loadDreq( manifest='out/dreqManifest.txt' ) 
    8989    for section in self.dq.coll : 
    9090      ks=[k for k in self.dq.coll[section].attDefn.keys() if self.dq.coll[section].attDefn[k].useClass == 'internalLink'] 
    9191      nerr = 0 
     92      cc = collections.defaultdict( int ) 
    9293      for i in self.dq.coll[section].items: 
    9394        for k in ks : 
     
    9596            if i.__dict__[k] not in self.dq.inx.uid: 
    9697              nerr += 1 
     98              cc[k] += 1 
    9799              ##print section, k, i.__dict__[k] 
    98100      if nerr > 0: 
    99            print ( 'Section %s: bad links: %s' % (section,nerr) ) 
     101           msg = '' 
     102           for k in cc: 
     103             msg += '%s: %s; ' % (k,cc[k]) 
     104           print ( 'Section %s: bad links: %s %s' % (section,nerr,msg) ) 
    100105           nn += nerr 
    101106      ##print section, ks, nerr 
Note: See TracChangeset for help on using the changeset viewer.