Package Bio :: Module File :: Class UndoHandle
[hide private]
[frames] | no frames]

Class UndoHandle

source code

object --+
         |
        UndoHandle

A Python handle that adds functionality for saving lines.

Saves lines in a LIFO fashion.

Added methods:
Instance Methods [hide private]
 
__init__(self, handle)
Initialize the class.
source code
 
__iter__(self)
Iterate over the lines in the File.
source code
 
__next__(self)
Return the next line.
source code
 
next(self)
Python 2 style alias for Python 3 style __next__ method.
source code
 
readlines(self, *args, **keywds)
Read all the lines from the file as a list of strings.
source code
 
readline(self, *args, **keywds)
Read the next line from the file as string.
source code
 
read(self, size=-1)
Read the File.
source code
 
saveline(self, line)
Store a line in the cache memory for later use.
source code
 
peekline(self)
Return the next line in the file, but do not move forward though the file.
source code
 
tell(self)
Return the current position of the file read/write pointer within the File.
source code
 
seek(self, *args)
Set the current position at the offset specified.
source code
 
__getattr__(self, attr)
Return File attribute.
source code
 
__enter__(self)
Call special method when opening the file using a with-statement.
source code
 
__exit__(self, type, value, traceback)
Call special method when closing the file using a with-statement.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, handle)
(Constructor)

source code 
Initialize the class.
Overrides: object.__init__

saveline(self, line)

source code 

Store a line in the cache memory for later use.

This acts to undo a readline, reflecting the name of the class: UndoHandle.