Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
Bio.PopGen.GenePop.Controller._FileIterator Class Reference

List of all members.

Public Member Functions

def __init__
def __iter__
def next
def __del__

Public Attributes

 func
 stream
 fname
 done

Detailed Description

Iterator which crawls over a stream of lines with a function.

   The generator function is expected to yield a tuple, while
   consuming input

Definition at line 139 of file Controller.py.


Constructor & Destructor Documentation

def Bio.PopGen.GenePop.Controller._FileIterator.__init__ (   self,
  func,
  stream,
  fname 
)

Definition at line 145 of file Controller.py.

00145 
00146     def __init__(self, func, stream, fname):
00147         self.func = func
00148         self.stream = stream
00149         self.fname = fname
00150         self.done = False

Definition at line 160 of file Controller.py.

00160 
00161     def __del__(self):
00162         self.stream.close()
00163         try:
00164             os.remove(self.fname)
00165         except OSError:
00166             #Jython seems to call the iterator twice
00167             pass


Member Function Documentation

Definition at line 151 of file Controller.py.

00151 
00152     def __iter__(self):
00153         if self.done:
00154             self.done = True
00155             raise StopIteration
00156         return self

Here is the caller graph for this function:

Definition at line 157 of file Controller.py.

00157 
00158     def next(self):
00159         return self.func(self)


Member Data Documentation

Definition at line 149 of file Controller.py.

Definition at line 148 of file Controller.py.

Definition at line 146 of file Controller.py.

Definition at line 147 of file Controller.py.


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