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

List of all members.

Public Member Functions

def fake

Public Attributes

 profile
 for easy follow thru on what gets scraped

Static Public Attributes

tuple ptx_matcher = PTX()

Detailed Description

Definition at line 105 of file adtemp.py.


Member Function Documentation

def Scraper::adtemp::AdTempFaker::fake (   self,
  inst,
  id,
  dt 
)
Invoked from base class, sets source instance attributes to form a fake 

:param inst: source instance
:param id:  suggested id to use
:param dt:  suggested date_time to use 

Note the settings can not easily be done in the framework as the ``inst`` can 
represent a join of multiple tables, requiring specialized action.

Definition at line 107 of file adtemp.py.

00108                                   :
00109         """
00110         Invoked from base class, sets source instance attributes to form a fake 
00111 
00112         :param inst: source instance
00113         :param id:  suggested id to use
00114         :param dt:  suggested date_time to use 
00115 
00116         Note the settings can not easily be done in the framework as the ``inst`` can 
00117         represent a join of multiple tables, requiring specialized action.
00118 
00119         """
00120         for k,v in inst.asdict.items():
00121             if k == 'id': 
00122                 setattr( inst , 'id' , id ) 
00123             elif k == 'date_time':
00124                 setattr( inst , 'date_time' , dt ) 
00125             else:
00126                 ptx = self.ptx_matcher(k)
00127                 if self.profile == "modulo_ramp":
00128                     if int(ptx) == 1:
00129                         setattr( inst, k, id )    ## for easy follow thru on what gets scraped
00130                     else:
00131                         setattr( inst, k, int(ptx)*10 + ( id % 10 )  )    
00132                 elif self.profile == "island_of_stability":
00133                     v = 0 if 10 < id < 20 else id % 10 
00134                     setattr( inst, k, int(ptx)*10 + v  )    
00135                 elif self.profile == "island_of_change":
00136                     v = id % 10 if 10 < id < 20 else 0 
00137                     setattr( inst, k, int(ptx)*10 + v  )    
00138                     
00139 


Member Data Documentation

Definition at line 106 of file adtemp.py.

for easy follow thru on what gets scraped

Definition at line 117 of file adtemp.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