[Biopython-dev] Bio.GenBank

Michiel de Hoon mjldehoon at yahoo.com
Sun Sep 4 02:09:13 EDT 2011


Dear all,

Currently, Bio/GenBank/__init__.py imports Bio.ParserSupport but uses very little of it. Therefore I would like to suggest to remove this dependency on ParserSupport from Bio/GenBank/__init__.py. I copied the corresponding patch below.
Any objections, anybody?

Best,
--Michiel

diff --git a/Bio/GenBank/__init__.py b/Bio/GenBank/__init__.py
index 43c10d4..df38abe 100644
--- a/Bio/GenBank/__init__.py
+++ b/Bio/GenBank/__init__.py
@@ -47,7 +47,6 @@ import re

 # other Biopython stuff
 from Bio import SeqFeature
-from Bio.ParserSupport import AbstractConsumer
 from Bio import Entrez

 # other Bio.GenBank stuff
@@ -389,7 +388,7 @@ class RecordParser(object):
         self._scanner.feed(handle, self._consumer)
         return self._consumer.data

-class _BaseGenBankConsumer(AbstractConsumer):
+class _BaseGenBankConsumer(object):
     """Abstract GenBank consumer providing useful general functions.

     This just helps to eliminate some duplication in things that most
@@ -404,6 +403,12 @@ class _BaseGenBankConsumer(AbstractConsumer):
     def __init__(self):
         pass

+    def _unhandled(self, data):
+        pass
+
+    def __getattr__(self, attr):
+        return self._unhandled
+
     def _split_keywords(self, keyword_string):
         """Split a string of keywords into a nice clean list.
         """



More information about the Biopython-dev mailing list