diff options
author | Sylvain <syt@logilab.fr> | 2007-07-13 17:39:09 +0200 |
---|---|---|
committer | Sylvain <syt@logilab.fr> | 2007-07-13 17:39:09 +0200 |
commit | 0eedb09972392840ab5edf373429615065921673 (patch) | |
tree | 71eeb2e2d75d54aa4bf21f4aa1f0a6cdd683fbb4 | |
parent | 7c9654aed91856da351cb1978b9eb732c270fbc8 (diff) | |
download | logilab-common-0eedb09972392840ab5edf373429615065921673.tar.gz |
see changelog
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | db.py | 26 |
2 files changed, 18 insertions, 13 deletions
@@ -1,6 +1,11 @@ ChangeLog for logilab.common ============================ + -- + * db: mark support_users and support_groups methods as obsolete in + favor of users_support and groups_support attributes, new + ilike_support property on dbms helpers + 2007-06-25 -- 0.22.2 * new 'typechanged' action for configuration.read_old_config @@ -19,6 +19,7 @@ import sys import re +from logilab.common.deprecation import obsolete try: from mx.DateTime import DateTimeType, DateTimeDeltaType, strptime HAS_MX_DATETIME = True @@ -402,15 +403,21 @@ class _GenericAdvFuncHelper: """ # DBMS resources descriptors and accessors - def support_users(self): + users_support = True + groups_support = True + ilike_support = True + + @obsolete('use users_support attribute') + def support_users(self):# XXX deprecated """return True if the DBMS support users (this is usually not true for in memory DBMS) """ - return True + return self.users_support + @obsolete('use groups_support attribute') def support_groups(self): """return True if the DBMS support groups""" - return True + return self.groups_support def system_database(self): """return the system database for the given driver""" @@ -463,7 +470,7 @@ INSERT INTO %s VALUES (0);''' % (seq_name, seq_name) return cursor.fetchone()[0] def list_users(self, cursor, username=None): - if not self.support_users(): + if not self.users_support: return None if username is None: return () @@ -549,15 +556,8 @@ class _SqliteAdvFuncHelper(_GenericAdvFuncHelper): An exception is raised when the functionality is not emulatable """ - def support_users(self): - """return True if the DBMS support users (this is usually - not true for in memory DBMS) - """ - return False - - def support_groups(self): - """return True if the DBMS support groups""" - return False + users_support = groups_support = False + ilike_support = False |