| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DybDbi::wrap Namespace Reference


Classes

class  Wrap

Functions

def RPT__del__
def RPT__getitem__
def RPT
def _create

Variables

tuple wd = Wrap(Dummy)
tuple d = Dummy()

Function Documentation

def DybDbi::wrap::RPT__del__ (   self  ) 

Definition at line 3 of file wrap.py.

00003                     :
00004     self.Delete()
00005 
def RPT__getitem__( self, i ):

def DybDbi::wrap::RPT__getitem__ (   self,
  i 
)

Definition at line 6 of file wrap.py.

00006                              :
00007     l = self.__len__()
00008     if isinstance( i , types.SliceType ):
00009         start, stop, step = i.start or 0, i.stop or l , i.step or 1
00010         if start < 0 and start >= -l:
00011             start += l
00012         if stop < 0 and stop >= -l:
00013             stop += l
00014         return [self.__getitem__(ii) for ii in range(start, stop, step )]
00015     elif isinstance( i , int ):
00016         if not(-l <= i < l):
00017             raise IndexError("out of range for index %d" % i )  
00018         if i < 0:
00019             i += l  
00020         return self.GetRow(i)
00021     else:
00022         raise TypeError("indexing expects a slice or integer ")
00023 
def RPT(cls):

def DybDbi::wrap::RPT (   cls  ) 

Application of function RPT to DbiRpt<T> classes 
provides instances of that class with a list-like 
interface supporting access by index and slice,
indices can be negative to provide access to the end.::
            
 
      r[0]      first
      r[-1]     last
                
      r[0:9]    first 10  
      r[-3:]    last 3   


      r[0:2000:500]  
      r[-10:-1:2]    2-step thru the last 10 

      for x in r[2540:]:
          print x

      for x in r[-10:]:
          print x 

THOUGHTS :
* no need for generator implementation for large result set as already all in memory anyhow

Definition at line 24 of file wrap.py.

00024             :
00025     """
00026     Application of function RPT to DbiRpt<T> classes 
00027     provides instances of that class with a list-like 
00028     interface supporting access by index and slice,
00029     indices can be negative to provide access to the end.::
00030                 
00031      
00032           r[0]      first
00033           r[-1]     last
00034                     
00035           r[0:9]    first 10  
00036           r[-3:]    last 3   
00037 
00038 
00039           r[0:2000:500]  
00040           r[-10:-1:2]    2-step thru the last 10 
00041 
00042           for x in r[2540:]:
00043               print x
00044 
00045           for x in r[-10:]:
00046               print x 
00047 
00048     THOUGHTS :
00049     * no need for generator implementation for large result set as already all in memory anyhow
00050 
00051     """
00052     cls.__len__ = cls.GetNumRows
00053     cls.__getitem__ = RPT__getitem__
00054     cls.__del__ = RPT__del__
00055     cls.__skip__ = "Row RowByIndex".split()
00056     cls.vrec = property( cls.GetValidityRec )
00057  
00058 
00059 
00060 
def _create(cls, *args, **kwargs):

def DybDbi::wrap::_create (   cls,
  args,
  kwargs 
) [private]

Provide pythonic instance creation classmethod::

    i = GCalibPmtSpec.Create( DarkRate=100. , ... ) 

doc from func

Definition at line 61 of file wrap.py.

00061                                  :
00062     """
00063     Provide pythonic instance creation classmethod::
00064 
00065         i = GCalibPmtSpec.Create( DarkRate=100. , ... ) 
00066 
00067     doc from func
00068     """
00069     instance = cls(*args)
00070     for k,v in kwargs.items():
00071         Set = getattr(cls,'Set%s'%k, None)
00072         if Set:
00073             Set( instance, v )   
00074         else:
00075             raise Exception("no such attribute %s", v )    
00076     return instance
00077 
00078 
class Wrap(object):


Variable Documentation

tuple DybDbi::wrap::wd = Wrap(Dummy) [static]

Definition at line 220 of file wrap.py.

tuple DybDbi::wrap::d = Dummy() [static]

Definition at line 222 of file wrap.py.

| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:17:17 2011 for DybDbi by doxygen 1.4.7