Skip to content

Commit

Permalink
Replace QUIET argument with PERMISSIVE=2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Rodrigues committed May 6, 2011
1 parent c1e8963 commit 5b44def
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Bio/PDB/PDBParser.py
Expand Up @@ -23,7 +23,7 @@ class PDBParser:
Parse a PDB file and return a Structure object.
"""

def __init__(self, PERMISSIVE=1, get_header=0, QUIET=0, structure_builder=None):
def __init__(self, PERMISSIVE=1, get_header=0, structure_builder=None):
"""
The PDB parser call a number of standard methods in an aggregated
StructureBuilder object. Normally this object is instanciated by the
Expand All @@ -35,11 +35,8 @@ def __init__(self, PERMISSIVE=1, get_header=0, QUIET=0, structure_builder=None):
o PERMISSIVE - int, if this is 0 exceptions in constructing the
SMCRA data structure are fatal. If 1 (DEFAULT), the exceptions are
caught, but some residues or atoms will be missing. THESE EXCEPTIONS
ARE DUE TO PROBLEMS IN THE PDB FILE!.
o QUIET - int, if this is 1, warnings issued in constructing the SMCRA data
will be supressed. If 0 (DEFAULT), they will not. These warnings might be
indicative of problems in the PDB file!
ARE DUE TO PROBLEMS IN THE PDB FILE!. If 2, these exceptions will be
caught but supressed from the output.
o structure_builder - an optional user implemented StructureBuilder class.
"""
Expand All @@ -51,7 +48,6 @@ def __init__(self, PERMISSIVE=1, get_header=0, QUIET=0, structure_builder=None):
self.trailer=None
self.line_counter=0
self.PERMISSIVE=PERMISSIVE
self.QUIET=QUIET

# Public methods

Expand All @@ -63,7 +59,7 @@ def get_structure(self, id, file):
o file - name of the PDB file OR an open filehandle
"""

if self.QUIET:
if self.PERMISSIVE == 2:
warning_list = warnings.filters[:]
warnings.filterwarnings('ignore', category=PDBConstructionWarning)

Expand All @@ -82,7 +78,7 @@ def get_structure(self, id, file):
if handle_close:
file.close()

if self.QUIET:
if self.PERMISSIVE == 2:
warnings.filters = warning_list

return structure
Expand Down

0 comments on commit 5b44def

Please sign in to comment.