Mercurial > hg > audiodb
changeset 632:41ef9e165c38
removed the raised warning as its behavior doesn't actually seem appropriate.
switched the default value of strictConfig so data doesn't accidentally get deleted.
author | map01bf |
---|---|
date | Wed, 23 Sep 2009 17:54:37 +0000 |
parents | 6ec50185b348 |
children | 1b3b303957bd |
files | bindings/python/pyadb.py |
diffstat | 1 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/bindings/python/pyadb.py Wed Sep 23 16:44:27 2009 +0000 +++ b/bindings/python/pyadb.py Wed Sep 23 17:54:37 2009 +0000 @@ -25,9 +25,6 @@ """error to indicate that a method has been called with incorrect args""" def __init__(self, msg): self.msg = msg -class ConfigWarning(Warning): - def __init__(self, msg): - self.msg = msg class Pyadb(object): """Pyadb class. Allows for creation, access, insertion and query of an audioDB vector matching database.""" @@ -106,6 +103,7 @@ for key in self.configQuery.keys(): if key not in Pyadb.validConfigTerms.keys(): if not scrub: return False + print "scrubbing %s from query config."%str(key) del self.configQuery[key] if not isinstance(self.configQuery[key], Pyadb.validConfigTerms[key]): if not scrub: return False @@ -114,15 +112,15 @@ # - def query(self, key=None, featData=None, strictConfig=False): + def query(self, key=None, featData=None, strictConfig=True): """query the database. Query parameters as defined in self.configQuery. For details on this consult the doc string in the configCheck method.""" if not self.configCheck(): if strictConfig: raise ValueError("configQuery dict contains unsupported terms and strict configure mode is on.\n\ Only keys found in Pyadb.validConfigTerms may be defined") else: - raise ConfigWarning("configQuery dict contains unsupported terms and strict configure mode is off.\n\ -Only keys found in Pyadb.validConfigTerms should be defined. Removing invalid terms and proceeding...") + print "configQuery dict contains unsupported terms and strict configure mode is off.\n\ +Only keys found in Pyadb.validConfigTerms should be defined. Removing invalid terms and proceeding..." self.configCheck(scrub=True) if ((not key and not featData) or (key and featData)): raise Usage("query require either key or featData to be defined, you have defined both or neither.")