/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 | Properties
DybPython::asciicat::AsciiRow Class Reference

List of all members.

Public Member Functions

def Create
def clone
def get_pk
def set_pk
def __str__

Static Public Attributes

tuple Create = classmethod(Create)

Properties

 pk = property(get_pk, set_pk)
 fv = property(lambda self:map(lambda k:self[k],self.t.fields), doc="list of field values in order held by AsciiCSV instance")

Detailed Description

Used internally by AsciiCSV::
 
     t = AsciiCSV( "~/path/to/catdir") 
     r = AsciiRow.Create(d, t ) 
     print r.pk    ##  (1,10) 
     print r.fv
     print r

Definition at line 34 of file asciicat.py.


Member Function Documentation

def DybPython::asciicat::AsciiRow::Create (   cls,
  d,
  t 
)
:param d: dict with row content
:param t: parent table AsciiCSV instance

Definition at line 45 of file asciicat.py.

00046                           :
00047         """
00048         :param d: dict with row content
00049         :param t: parent table AsciiCSV instance
00050         """
00051         r = cls(d)
00052         r.t = t
        return r
def DybPython::asciicat::AsciiRow::clone (   self)

Definition at line 55 of file asciicat.py.

00056                    :
00057         return AsciiRow.Create( dict(self).copy() , self.t )

def DybPython::asciicat::AsciiRow::get_pk (   self)

Definition at line 58 of file asciicat.py.

00059                     :
00060         if self.t.intpk:
00061             fv = map(lambda k:int(self[k]),self.t.pkfields)
00062         else:
00063             fv = map(lambda k:self[k],self.t.pkfields)
        return fv[0] if len(fv) == 1 else tuple(fv)
def DybPython::asciicat::AsciiRow::set_pk (   self,
  pk 
)

Definition at line 64 of file asciicat.py.

00065                           :
00066         if type(pk) == int:pk = tuple([pk])     ## type regularize
00067         assert len(pk) == len(self.t.pkfields), "pk %r is wrong shape expecting %r " % ( pk, self.t.pkfields )
00068         for k,v in zip(self.t.pkfields,pk):
            self[k] = str(v)               ## so faked entries match kosher ones hailing from csv files   
def DybPython::asciicat::AsciiRow::__str__ (   self)

Definition at line 71 of file asciicat.py.

00072                      :
00073          return ",".join(map(lambda _:"\"%s\""%_[0] if _[1] else _[0], zip(self.fv,self.t.quote))) 
00074 


Member Data Documentation

tuple DybPython::asciicat::AsciiRow::Create = classmethod(Create) [static]

Definition at line 53 of file asciicat.py.


Property Documentation

DybPython::asciicat::AsciiRow::pk = property(get_pk, set_pk) [static]

Definition at line 69 of file asciicat.py.

DybPython::asciicat::AsciiRow::fv = property(lambda self:map(lambda k:self[k],self.t.fields), doc="list of field values in order held by AsciiCSV instance") [static]

Definition at line 70 of file asciicat.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:55:40 for DybPython by doxygen 1.7.4