/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 | Static Public Attributes
Scraper::mucalcopy::MuCalCopyFaker Class Reference
Inheritance diagram for Scraper::mucalcopy::MuCalCopyFaker:
Inheritance graph
[legend]
Collaboration diagram for Scraper::mucalcopy::MuCalCopyFaker:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def fake

Static Public Attributes

tuple lcr_matcher = LCR()

Detailed Description

Creates fake instances and inserts them into sourcedb   

Definition at line 152 of file mucalcopy.py.


Member Function Documentation

def Scraper::mucalcopy::MuCalCopyFaker::fake (   self,
  inst,
  id,
  dt 
)
Invoked from base class call method, 
set attributes of source instance to form a fake 

:param inst: source instance
:param id: id to assign to the instance instance

Definition at line 157 of file mucalcopy.py.

00158                                   :
00159         """
00160         Invoked from base class call method, 
00161         set attributes of source instance to form a fake 
00162 
00163         :param inst: source instance
00164         :param id: id to assign to the instance instance
00165         """
00166         fakefn=lambda (l,c,r),qty:l*100 + c*10 + r if qty == "voltage" else 1 
00167         for k,v in inst.asdict.items():
00168             if k in 'id P_id'.split():
00169                  setattr( inst, k, id )
00170             elif k in 'date_time P_date_time'.split():
00171                  setattr( inst, k, dt )
00172             else:
00173                 qty,kk = ('pw',k[2:]) if k.startswith('P_') else ('voltage',k)
00174                 lcr = self.lcr_matcher(kk)    
00175                 setattr( inst , k, fakefn( lcr, qty) )
00176 


Member Data Documentation

Definition at line 156 of file mucalcopy.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