Permalink
Browse files

Fix generic warning class for BioSQL PostgreSQL schema rules

  • Loading branch information...
1 parent 8f8996e commit 483e7b787ba7b9f12e049b89e385997cce55dd6f @peterjc peterjc committed Jan 8, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 BioSQL/BioSeqDatabase.py
View
7 BioSQL/BioSeqDatabase.py
@@ -91,14 +91,15 @@ def open_database(driver="MySQLdb", **kwargs):
"rulename='rule_bioentry_i2';"
if server.adaptor.execute_and_fetchall(sql):
import warnings
+ from Bio import BiopythonWarning
warnings.warn("Your BioSQL PostgreSQL schema includes some "
"rules currently required for bioperl-db but "
"which may cause problems loading data using "
"Biopython (see BioSQL Bug 2839). If you do not "
"use BioPerl, please remove these rules. "
"Biopython should cope with the rules present, "
"but with a performance penalty when loading "
- "new records.")
+ "new records.", BiopythonWarning)
global _POSTGRES_RULES_PRESENT
_POSTGRES_RULES_PRESENT = True
@@ -200,7 +201,9 @@ def remove_database(self, db_name):
del server[name]
"""
import warnings
- warnings.warn("This method is obsolete. In keeping with the dictionary interface, you can now use 'del server[name]' instead", PendingDeprecationWarning)
+ warnings.warn("This method is obsolete. In keeping with the "
+ "dictionary interface, you can now use 'del "
+ "server[name]' instead", PendingDeprecationWarning)
db_id = self.adaptor.fetch_dbid_by_dbname(db_name)
remover = Loader.DatabaseRemover(self.adaptor, db_id)
remover.remove()

0 comments on commit 483e7b7

Please sign in to comment.