Back to index

python-biopython  1.60
Public Member Functions | Private Member Functions | Private Attributes
Bio.ParserSupport.SGMLStrippingConsumer Class Reference

List of all members.

Public Member Functions

def __init__
def __getattr__

Private Member Functions

def _apply_clean_data

Private Attributes


Detailed Description

A consumer that strips off SGML tags.

This is meant to be used as a decorator for other consumers.

Definition at line 127 of file

Constructor & Destructor Documentation

def Bio.ParserSupport.SGMLStrippingConsumer.__init__ (   self,

Definition at line 133 of file

00134     def __init__(self, consumer):
00135         import Bio
00136         warnings.warn("SGMLStrippingConsumer is deprecated, and is likely to be removed in a future version of Biopython", Bio.BiopythonDeprecationWarning)
00137         if type(consumer) is not InstanceType:
00138             raise ValueError("consumer should be an instance")
00139         self._consumer = consumer
00140         self._prev_attr = None
00141         self._stripper = File.SGMLStripper()

Member Function Documentation

Definition at line 146 of file

00147     def __getattr__(self, name):
00148         if name in ['_prev_attr', '_stripper']:
00149             return getattr(self, name)
00150         attr = getattr(self._consumer, name)
00151         # If this is not a method, then return it as is.
00152         if type(attr) is not MethodType:
00153             return attr
00154         # If it's a section method, then return it.
00155         if name[:6] == 'start_' or name[:4] == 'end_':
00156             return attr
00157         # Otherwise, it's an info event, and return my method.
00158         self._prev_attr = attr
00159         return self._apply_clean_data
# onle use the Event Generator if XML handling is okay

Here is the call graph for this function:

def Bio.ParserSupport.SGMLStrippingConsumer._apply_clean_data (   self,
) [private]

Definition at line 142 of file

00143     def _apply_clean_data(self, data):
00144         clean = self._stripper.strip(data)
00145         self._prev_attr(clean)

Here is the caller graph for this function:

Member Data Documentation

Definition at line 138 of file

Definition at line 139 of file

Definition at line 140 of file

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