/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::adwphv::AdWpHvFaker Class Reference
Inheritance diagram for Scraper::adwphv::AdWpHvFaker:
Inheritance graph
[legend]
Collaboration diagram for Scraper::adwphv::AdWpHvFaker:
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 319 of file adwphv.py.


Member Function Documentation

def Scraper::adwphv::AdWpHvFaker::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 324 of file adwphv.py.

00325                                   :
00326         """
00327         Invoked from base class call method, 
00328         set attributes of source instance to form a fake 
00329 
00330         :param inst: source instance
00331         :param id: id to assign to the instance instance
00332         """
00333         fakefn=lambda (l,c,r),qty:l*100 + c*10 + r if qty == "voltage" else 1 
00334         for k,v in inst.asdict.items():
00335             if k in 'id P_id'.split():
00336                  setattr( inst, k, id )
00337             elif k in 'date_time P_date_time'.split():
00338                  setattr( inst, k, dt )
00339             else:
00340                 qty,kk = ('pw',k[2:]) if k.startswith('P_') else ('voltage',k)
00341                 lcr = self.lcr_matcher(kk)    
00342                 setattr( inst , k, fakefn( lcr, qty) )
00343 


Member Data Documentation

Definition at line 323 of file adwphv.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