summaryrefslogtreecommitdiff
path: root/webapp.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2013-03-09 18:37:24 +0100
committerHelmut Grohne <helmut@subdivi.de>2013-03-09 18:37:24 +0100
commit423ceee0d0befc8755a9ae915d15e8d415d98159 (patch)
treec81405fc5aa7a21bcf8f841aa92cfe1f00d59012 /webapp.py
parente0dd701f41a874c1c06702d849fe4b860a450e3e (diff)
downloaddebian-dedup-423ceee0d0befc8755a9ae915d15e8d415d98159.tar.gz
webapp: drop unused function compute_sharedstats
The sharing table works great and I don't want to adapt it for the next step in the schema change.
Diffstat (limited to 'webapp.py')
-rwxr-xr-xwebapp.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/webapp.py b/webapp.py
index 0e4dc15..f80b3da 100755
--- a/webapp.py
+++ b/webapp.py
@@ -253,30 +253,6 @@ class Application(object):
(package,))
return set(row[0] for row in fetchiter(cur))
- def compute_sharedstats(self, package):
- cur = self.db.cursor()
- sharedstats = {}
- for func1, func2 in hash_functions:
- cur.execute("SELECT a.filename, a.hash, a.size, b.package FROM content AS a JOIN content AS b ON a.hash = b.hash WHERE a.package = ? AND a.function = ? AND b.function = ? AND (a.filename != b.filename OR b.package != ?);",
- (package, func1, func2, package))
- sharing = dict()
- for afile, hashval, size, bpkg in fetchiter(cur):
- hashdict = sharing.setdefault(bpkg, dict())
- fileset = hashdict.setdefault(hashval, (size, set()))[1]
- fileset.add(afile)
- if sharing:
- sharedstats[function_combination(func1, func2)] = curstats = []
- mapping = sharing.pop(package, dict())
- if mapping:
- duplicate = sum(len(files) for _, files in mapping.values())
- savable = sum(size * (len(files) - 1) for size, files in mapping.values())
- curstats.append(dict(package=None, duplicate=duplicate, savable=savable))
- for pkg, mapping in sharing.items():
- duplicate = sum(len(files) for _, files in mapping.values())
- savable = sum(size * len(files) for size, files in mapping.values())
- curstats.append(dict(package=pkg, duplicate=duplicate, savable=savable))
- return sharedstats
-
def cached_sharedstats(self, package):
cur = self.db.cursor()
sharedstats = {}