Skip to content

Commit

Permalink
fixed a bug reported by Andreas Kuntzagk (andreas.kuntzagk@mdc-berlin…
Browse files Browse the repository at this point in the history
….de)

NCBI efetch was returning stuff in a weird format, breaking
NCBIDictionary.  Now NCBIDictionary uses "gb" format by default,
and allows the user to change it in the constructor.
  • Loading branch information
jchang committed Nov 13, 2002
1 parent 21c3944 commit f6f7c16
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Bio/GenBank/__init__.py
Expand Up @@ -1461,7 +1461,8 @@ class NCBIDictionary:
Methods:
"""
def __init__(self, database='sequences', delay=5.0, parser=None):
def __init__(self, database='sequences', format="gb", delay=5.0,
parser=None):
"""NCBIDictionary([database][, delay][, parser])
Create a new Dictionary to access GenBank. Valid values for
Expand All @@ -1475,7 +1476,9 @@ def __init__(self, database='sequences', delay=5.0, parser=None):
self.parser = parser
self.limiter = RequestLimiter(delay)
self.database = database
if self.database == 'nucleotide':
if format:
self.format = format
elif self.database == 'nucleotide':
self.format = 'gb'
elif self.database == 'protein' or self.database == 'popset':
self.format = 'gp'
Expand Down

0 comments on commit f6f7c16

Please sign in to comment.