diff options
author | sylvain thenault <sylvain.thenault@logilab.fr> | 2009-01-26 13:49:55 +0100 |
---|---|---|
committer | sylvain thenault <sylvain.thenault@logilab.fr> | 2009-01-26 13:49:55 +0100 |
commit | da01da92740c5210af6e56361084ba3cb5855e9d (patch) | |
tree | 47053000808754fb1a2d7be1faab5732acf92728 | |
parent | 85357ee284a99b2af1a90630f5b2e0f5822ec9dc (diff) | |
download | logilab-common-da01da92740c5210af6e56361084ba3cb5855e9d.tar.gz |
pylint fixes, kill some old bw compat code
-rw-r--r-- | __init__.py | 47 | ||||
-rw-r--r-- | adbh.py | 6 | ||||
-rw-r--r-- | optik_ext.py | 6 |
3 files changed, 4 insertions, 55 deletions
diff --git a/__init__.py b/__init__.py index f5bc28d..d59632d 100644 --- a/__init__.py +++ b/__init__.py @@ -27,53 +27,6 @@ STD_BLACKLIST = ('CVS', '.svn', '.hg', 'debian', 'dist', 'build') IGNORED_EXTENSIONS = ('.pyc', '.pyo', '.elc', '~') -from logilab.common.deprecation import moved - -get_cycles = moved('logilab.common.graph', 'get_cycles') -cached = moved('logilab.common.decorators', 'cached') -ProgressBar = moved('logilab.common.shellutils', 'ProgressBar') -Execute = moved('logilab.common.shellutils', 'Execute') -acquire_lock = moved('logilab.common.shellutils', 'acquire_lock') -release_lock = moved('logilab.common.shellutils', 'release_lock') -deprecated_function = moved('logilab.common.deprecation', 'deprecated_function') -class_renamed = moved('logilab.common.deprecation', 'class_renamed') - -def intersection(list1, list2): - """Return the intersection of list1 and list2.""" - warn('this function is deprecated, use a set instead', DeprecationWarning, - stacklevel=2) - intersect_dict, result = {}, [] - for item in list1: - intersect_dict[item] = 1 - for item in list2: - if item in intersect_dict: - result.append(item) - return result - -def difference(list1, list2): - """Return elements of list1 not in list2.""" - warn('this function is deprecated, use a set instead', DeprecationWarning, - stacklevel=2) - tmp, result = {}, [] - for i in list2: - tmp[i] = 1 - for i in list1: - if i not in tmp: - result.append(i) - return result - -def union(list1, list2): - """Return list1 union list2.""" - warn('this function is deprecated, use a set instead', DeprecationWarning, - stacklevel=2) - tmp = {} - for i in list1: - tmp[i] = 1 - for i in list2: - tmp[i] = 1 - return tmp.keys() - - class attrdict(dict): """A dictionary for which keys are also accessible as attributes.""" def __getattr__(self, attr): @@ -385,12 +385,8 @@ class _PGAdvFuncHelper(_GenericAdvFuncHelper): cursor.execute('CREATE LANGUAGE %s' % extlang) print '%s language installed' % extlang - def list_users(self, cursor, username=None): + def list_users(self, cursor): """return the list of existing database users""" - if username: - warn('username argument is deprecated, use user_exists method', - DeprecationWarning, stacklevel=2) - return self.user_exists(cursor, username) cursor.execute("SELECT usename FROM pg_user") return [r[0] for r in cursor.fetchall()] diff --git a/optik_ext.py b/optik_ext.py index 81d75a8..01537ee 100644 --- a/optik_ext.py +++ b/optik_ext.py @@ -169,11 +169,11 @@ def check_color(option, opt, value): def check_time(option, opt, value): from logilab.common.textutils import TIME_UNITS, apply_units - apply_unit(value, TIME_UNITS) + apply_units(value, TIME_UNITS) def check_bytes(option, opt, value): - from logilab.common.textutils import BYTES_UNITS, apply_units - apply_unit(value, BYTES_UNITS) + from logilab.common.textutils import BYTE_UNITS, apply_units + apply_units(value, BYTE_UNITS) import types |