summaryrefslogtreecommitdiff
path: root/portato/db/sql.py
diff options
context:
space:
mode:
Diffstat (limited to 'portato/db/sql.py')
-rw-r--r--portato/db/sql.py16
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):