/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes
DybPython::aux::auxlog::AuxHistory Class Reference

List of all members.

Public Member Functions

def __init__
def path
def load

Public Attributes

 relpath

Detailed Description

LOCALSEQNO history from dybaux 

Definition at line 88 of file auxlog.py.


Constructor & Destructor Documentation

def DybPython::aux::auxlog::AuxHistory::__init__ (   self,
  revs,
  relpath = 'LOCALSEQNO/LOCALSEQNO.csv' 
)

Definition at line 92 of file auxlog.py.

00093                                                                    :
00094         dict.__init__(self)
00095         self.relpath = relpath
00096         for rev in revs:
            self.load(rev)

Member Function Documentation

def DybPython::aux::auxlog::AuxHistory::path (   self,
  rev 
)

Definition at line 97 of file auxlog.py.

00098                         :
00099         p = os.path.join( tmpdir() , "auxhistory", self.relpath , "%s.csv" % rev ) 
        return path_(p)        
def DybPython::aux::auxlog::AuxHistory::load (   self,
  rev 
)

Definition at line 100 of file auxlog.py.

00101                          :
00102         path = self.path(rev)
00103         relpath = self.relpath
00104         if not os.path.exists(path):
00105             cmd = "curl -u dayabay:$(cat ~/.dybpass) 'http://dayabay.ihep.ac.cn/svn/dybaux/!svn/bc/%(rev)s/catalog/tmp_offline_db/%(relpath)s' -o '%(path)s' " % locals()
00106             print cmd,
00107             rc = os.popen(cmd).read()
00108             print "==> %s " % rc
00109 
00110         assert os.path.exists(path), "failed to create '%s' " % path 
00111         csv = AsciiCSV(None, path )()
00112         if relpath == 'LOCALSEQNO/LOCALSEQNO.csv':
00113             self[rev] = csv.lastusedseqno 
00114         elif relpath.endswith('Vld.csv'):
00115             if len(csv) > 0:
00116                 rng = (min(csv),max(csv))                 ## Vld table csv is keyed by SEQNO... full content is available 
00117                 if relpath.startswith('CalibPmtSpec'):
00118                     log.warn("skipping assertion wrt missing SEQNO that CalibPmtSpec fails miserably  SEQNO range %s length %s " % ( rng, len(csv) ) ) 
00119                     msg = "" if rng[1] - rng[0] + 1 == len(csv) else "non-contiguous"
00120                     range='%s:%s %s' % (rng[0],rng[1],msg)
00121                 else:
00122                     assert rng[1] - rng[0] + 1 == len(csv)
00123                     range='%s:%s' % rng 
00124             else:
00125                 range='empty' 
00126 
00127             self[rev] = dict(range=range)
00128 
00129 


Member Data Documentation

Definition at line 92 of file auxlog.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:55:40 for DybPython by doxygen 1.7.4