diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2009-01-28 13:13:56 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2009-01-28 13:13:56 +0100 |
commit | 816fbaf42407fbbb8466c0d08d64fc11f605e5b6 (patch) | |
tree | 319eddc33bddd69ddea511a7972dcba9cc1e822c /portato/db/sql.py | |
parent | 320f6f6270853b0209611ac6ec642994a90220b5 (diff) | |
download | portato-816fbaf42407fbbb8466c0d08d64fc11f605e5b6.tar.gz portato-816fbaf42407fbbb8466c0d08d64fc11f605e5b6.tar.bz2 portato-816fbaf42407fbbb8466c0d08d64fc11f605e5b6.zip |
Use the new database class layout
Diffstat (limited to '')
-rw-r--r-- | portato/db/sql.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/portato/db/sql.py b/portato/db/sql.py index c80fd91..e7be91e 100644 --- a/portato/db/sql.py +++ b/portato/db/sql.py @@ -22,8 +22,8 @@ import hashlib import os from functools import wraps -from threading import RLock +from ..constants import SESSION_DIR from ..helper import info, error, debug from ..backend import system from .database import Database, PkgData @@ -31,11 +31,13 @@ from .database import Database, PkgData class SQLDatabase (Database): FORBIDDEN = (".bzr", ".svn", ".git", "CVS", ".hg", "_darcs") + lock = Database.lock def __init__ (self): """Constructor.""" + Database.__init__(self) + self._restrict = "" - self._lock = RLock() pkgdb = os.path.join(SESSION_DIR, "package.db") pkgdb_existed = os.path.exists(pkgdb) @@ -130,16 +132,6 @@ class SQLDatabase (Database): return changed - def lock (f): - @wraps(f) - def wrapper (self, *args, **kwargs): - with self._lock: - r = f(self, *args, **kwargs) - - return r - - return wrapper - def con (f): @wraps(f) def wrapper (*args, **kwargs): |