summaryrefslogtreecommitdiff
path: root/portato/db
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-03-05 02:24:50 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-03-05 02:24:50 +0100
commitf254bd593f3c1842658f4fb57fa87ed77d9fe993 (patch)
treee7c4d02452a940442184b6932b757e98fa61605f /portato/db
parent1cb4b2447dd451bd23602f91e08a53538514c13f (diff)
downloadportato-f254bd593f3c1842658f4fb57fa87ed77d9fe993.tar.gz
portato-f254bd593f3c1842658f4fb57fa87ed77d9fe993.tar.bz2
portato-f254bd593f3c1842658f4fb57fa87ed77d9fe993.zip
Previous commits done more correct :P
Diffstat (limited to '')
-rw-r--r--portato/db/eix_sql.py6
-rw-r--r--portato/db/sql.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/portato/db/eix_sql.py b/portato/db/eix_sql.py
index 39e556b..fd145cc 100644
--- a/portato/db/eix_sql.py
+++ b/portato/db/eix_sql.py
@@ -42,7 +42,7 @@ class EixSQLDatabase (SQLDatabase):
SQLDatabase.__init__(self, session)
def search_types(self):
- return Database.SEARCH_NAME | Database.SEARCH_DESCRIPTION
+ return self.SEARCH_NAME | self.SEARCH_DESCRIPTION
def updated (self):
mtime = os.stat(self.cache).st_mtime
@@ -66,7 +66,7 @@ class EixSQLDatabase (SQLDatabase):
if category is None or cat.name == category:
for pkg in cat.packages:
p = "%s/%s" % (cat.name, pkg.name)
- yield (cat.name, pkg.name, pkg.desription, p in inst, False)
+ yield (cat.name, pkg.name, pkg.description, p in inst, False)
- connection.executemany("INSERT INTO packages (cat, name, descr, inst, disabled) VALUES (?, ?, ?, ?)", _get())
+ connection.executemany("INSERT INTO packages (cat, name, descr, inst, disabled) VALUES (?, ?, ?, ?, ?)", _get())
connection.commit()
diff --git a/portato/db/sql.py b/portato/db/sql.py
index 48de9eb..02ce172 100644
--- a/portato/db/sql.py
+++ b/portato/db/sql.py
@@ -85,7 +85,7 @@ class SQLDatabase (Database):
pkg_conn.close()
def search_types(self):
- return Database.SEARCH_NAME
+ return self.SEARCH_NAME
def updated (self):
changed = False
@@ -259,13 +259,13 @@ class SQLDatabase (Database):
restrict = restrict.replace(".*","%").replace(".","_")
rest = ""
- if self._type & Database.NAME_DESCRIPTION:
+ if self._type & self.SEARCH_NAME:
if "/" in restrict:
rest = "(name LIKE '%s%%' AND cat LIKE '%s')" % (pkg, cat)
else:
rest = "(name LIKE '%%%(restrict)s%%' OR cat LIKE '%(restrict)s%%')" % {"restrict":restrict}
- if self._type & Database.SEARCH_DESCRIPTION:
+ if self._type & self.SEARCH_DESCRIPTION:
r = "descr LIKE '%%%(restrict)s%%'" % {"restrict":restrict}
if not rest:
rest = "(%s OR %s)" % (r, rest)