/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 | Properties | Private Member Functions
Scraper::daq::daqscr::DaqScraper Class Reference

List of all members.

Public Member Functions

def __init__
def __call__

Public Attributes

 sleep
 offset_seconds
 cfg
 fileinfo
 runinfo
 confinfo
 last
 does DAQ querying

Properties

 lastcut = property(lambda self:self.last.localstart)

Private Member Functions

def _initialize_last

Detailed Description

Definition at line 11 of file daqscr.py.


Constructor & Destructor Documentation

def Scraper::daq::daqscr::DaqScraper::__init__ (   self,
  cfg 
)
:param cfg: 

Definition at line 12 of file daqscr.py.

00012                             :    
00013         """
00014         :param cfg: 
00015         """
00016         log.info("DaqScraper.__init__ %s " % cfg )
00017         daqm = MetaDB(cfg['source'])
00018         offm = MetaDB(cfg['target'])
00019 
00020         fileinfo = FileInfo(source=daqm, target=offm )
00021         runinfo  = RunInfo(source=daqm, target=offm )
00022         confinfo = ConfInfo(source=daqm, target=offm )
00023 
00024         if cfg.get('testdb',None):
00025             fileinfo['testdb'] = MetaDB(cfg['testdb'])
00026 
00027         self.sleep          = cfg.pop('sleep')
00028         self.offset_seconds = cfg.pop('offset_seconds')
00029 
00030         assert self.offset_seconds < 0 , "offset_seconds expected to be negative, eg -60 " 
00031 
00032         self.cfg = cfg
00033         self.fileinfo = fileinfo
00034         self.runinfo = runinfo
00035         self.confinfo = confinfo
00036 
00037         last = self._initialize_last()
00038         assert last, "DaqScraper failed to find last file entry "
00039         self.last = last
00040 

Member Function Documentation

def Scraper::daq::daqscr::DaqScraper::_initialize_last (   self) [private]

Definition at line 41 of file daqscr.py.

00042                               :
00043         last = self.fileinfo.last()
00044         log.info("_initialize_last %r " % last ) 
00045         log.info("_initialize_last localstart %r " % last.localstart )
00046         return last  

def Scraper::daq::daqscr::DaqScraper::__call__ (   self,
  cut = None,
  Spin,
  the,
  scrape,
  while,
  loop,
  if,
  not,
  cut 
)

Definition at line 49 of file daqscr.py.

00054                   :
00055             cut = self.lastcut
00056         log.info("DaqScraper.__call__ starting from cut %r " % cut )
00057 
00058         runinfo = self.runinfo
00059         confinfo = self.confinfo
00060 
00061         while True:
00062             self[:] = self.fileinfo.after( cut, offset_seconds=self.offset_seconds  )
00063             for fi in self:
00064                 runinfo.run = fi.RUNNR          
00065                 if not runinfo.is_collected:
00066                     runinfo()          ## does DAQ querying
00067                     if runinfo.is_valid:
00068                         log.info( "runinfo valid %r " % runinfo )
00069 
00070                         if runinfo.is_calibrun:
00071                             cri = runinfo.make_CalibRunInfo()
00072 
00073                         confinfo.versions = (runinfo['schemaVersion'], runinfo['dataVersion'], runinfo['baseVersion'] )                     
00074  
00075 
00076                     else:
00077                         log.warn("runinfo errors %s " % "\n".join(ri.errors) )
00078 
00079             if len(self)>0:
00080                 self.last = self[-1]  
00081             time.sleep(self.sleep.seconds) 
00082 


Member Data Documentation

Definition at line 14 of file daqscr.py.

Definition at line 14 of file daqscr.py.

Definition at line 14 of file daqscr.py.

Definition at line 14 of file daqscr.py.

Definition at line 14 of file daqscr.py.

Definition at line 14 of file daqscr.py.

does DAQ querying

Definition at line 14 of file daqscr.py.


Property Documentation

Scraper::daq::daqscr::DaqScraper::lastcut = property(lambda self:self.last.localstart) [static]

Definition at line 47 of file daqscr.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:50:03 for Scraper by doxygen 1.7.4