diff options
author | Sean Finney <seanius@debian.org> | 2008-07-06 14:19:19 +0200 |
---|---|---|
committer | Sean Finney <seanius@debian.org> | 2008-07-06 14:19:19 +0200 |
commit | a096be35d331813b6e786d0ea95165c9fbee2d51 (patch) | |
tree | 71789fc953120eb991ad5fc04cfb6879a426388b | |
parent | bf3c216bb1c47fedc5690efb4d275a8aa0b0ad25 (diff) | |
download | patch-tracker-a096be35d331813b6e786d0ea95165c9fbee2d51.tar.gz |
bugfix: don't automatically prune in destructor
otherwise its gets pruned every page visit, whoops.
-rwxr-xr-x | gen-patch-info.py | 2 | ||||
-rw-r--r-- | patchtracker/DB.py | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/gen-patch-info.py b/gen-patch-info.py index 2efe0a1..0d579af 100755 --- a/gen-patch-info.py +++ b/gen-patch-info.py @@ -41,4 +41,6 @@ if __name__ == '__main__': db.relateSourcePackage(name=p.name, version=p.version, suite=s, component=c) + db.prune() + db.unmark() db.finalize() diff --git a/patchtracker/DB.py b/patchtracker/DB.py index a81fb19..da0838a 100644 --- a/patchtracker/DB.py +++ b/patchtracker/DB.py @@ -143,12 +143,17 @@ class PatchTrackerDB: except: return None - def finalize(self): - q1 = "DELETE FROM package_rel_map WHERE marked != 1" + def prune(self): + q = "DELETE FROM package_rel_map WHERE marked != 1" + cursor = self.db.cursor() + cursor.execute(q) + + def unmark(self): + q = "UPDATE package_rel_map SET marked=0" cursor = self.db.cursor() - cursor.execute(q1) - q2 = "UPDATE package_rel_map SET marked=0" - cursor.execute(q2) + cursor.execute(q) + + def finalize(self): self.db.commit() def __del__(self): |