/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
Scraper::base::enum::Enum Class Reference

List of all members.

Public Member Functions

def __init__
def __getattr__
def whatis

Public Attributes

 lookup
 reverse

Detailed Description

Enum based on a list with reverse lookups

Definition at line 3 of file enum.py.


Constructor & Destructor Documentation

def Scraper::base::enum::Enum::__init__ (   self,
  args 
)

Definition at line 7 of file enum.py.

00008                              :
00009         list.__init__(self, *args )
00010         lookup = {}
00011         reverse = {}
00012         for i,x in enumerate(self):
00013             lookup[x] = i
00014             reverse[i] = x
00015         self.lookup = lookup
        self.reverse = reverse

Member Function Documentation

def Scraper::base::enum::Enum::__getattr__ (   self,
  attr 
)

Definition at line 16 of file enum.py.

00017                                :
00018         if not self.lookup.has_key(attr):
00019             raise AttributeError
        return self.lookup[attr]
def Scraper::base::enum::Enum::whatis (   self,
  value 
)

Definition at line 20 of file enum.py.

00021                            :
00022         return self.reverse[value]
00023 


Member Data Documentation

Definition at line 7 of file enum.py.

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