Back to index

python-biopython  1.60
Public Member Functions
Bio.DocSQL.QueryRow Class Reference
Inheritance diagram for Bio.DocSQL.QueryRow:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def __getattr__
def __setattr__

Detailed Description

Definition at line 49 of file DocSQL.py.


Constructor & Destructor Documentation

def Bio.DocSQL.QueryRow.__init__ (   self,
  cursor 
)

Definition at line 50 of file DocSQL.py.

00050 
00051     def __init__(self, cursor):
00052         try:
00053             row = cursor.fetchone()
00054             super(QueryRow, self).__init__(row)
00055         except TypeError:
00056             raise StopIteration
00057 
00058         object.__setattr__(self, "_names", [x[0] for x in cursor.description]) # FIXME: legacy
00059         object.__setattr__(self, "_names_hash", {})
00060         
00061         for i, name in enumerate(self._names):
00062             self._names_hash[name] = i

Here is the caller graph for this function:


Member Function Documentation

def Bio.DocSQL.QueryRow.__getattr__ (   self,
  name 
)

Definition at line 63 of file DocSQL.py.

00063 
00064     def __getattr__(self, name):
00065         _check_is_public(name)
00066         try:
00067             return self[self._names_hash[name]]
00068         except (KeyError, AttributeError):
00069             raise AttributeError("'%s' object has no attribute '%s'" \
00070                                  % (self.__class__.__name__, name))

Here is the call graph for this function:

def Bio.DocSQL.QueryRow.__setattr__ (   self,
  name,
  value 
)

Definition at line 71 of file DocSQL.py.

00071 
00072     def __setattr__(self, name, value):
00073         try:
00074             self._names_hash
00075         except AttributeError:
00076             return object.__setattr__(self, name, value)
00077             
00078         _check_is_public(name)
00079         try:
00080             index = self._names_hash[name]
00081             self[index] = value
00082         except KeyError:
00083             return object.__setattr__(self, name, value)

Here is the call graph for this function:


The documentation for this class was generated from the following file: