summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain <syt@logilab.fr>2007-07-13 17:39:09 +0200
committerSylvain <syt@logilab.fr>2007-07-13 17:39:09 +0200
commit0eedb09972392840ab5edf373429615065921673 (patch)
tree71eeb2e2d75d54aa4bf21f4aa1f0a6cdd683fbb4
parent7c9654aed91856da351cb1978b9eb732c270fbc8 (diff)
downloadlogilab-common-0eedb09972392840ab5edf373429615065921673.tar.gz
see changelog
-rw-r--r--ChangeLog5
-rw-r--r--db.py26
2 files changed, 18 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 233d8f1..50dfba8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/db.py b/db.py
index c150314..f01c0f9 100644
--- a/db.py
+++ b/db.py
@@ -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