X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsearchfile.py;h=3930c77c570b8f1a68f598d768cef749d357b128;hb=fe38edb22b98124b6a0223e594e5d9c96dd2dcaf;hp=e12839698e1a6405ce02686f41c360e5155e2dc9;hpb=6f27156fbe17573b80e391160d4862f5ad19da18;p=findit diff --git a/src/searchfile.py b/src/searchfile.py index e128396..3930c77 100755 --- a/src/searchfile.py +++ b/src/searchfile.py @@ -5,13 +5,15 @@ class SearchFile(object): - def __init__(self, vvod, config, result): - self.path, self.count = vvod.get_st_par() + def __init__(self, vvod, config): + self.path, self.count = vvod if not self.path: self.path = config.get("default_start_dir") if not self.count: self.count = config.get("default_count") - self.result = result + + from resultlist import ResultList + self.result = ResultList() def filesorter(self, dir): import os @@ -25,4 +27,5 @@ class SearchFile(object): def run(self): import heapq for fsize, fpath in heapq.nlargest(self.count, self.filesorter(self.path)): - self.result.add((fpath, fsize)) \ No newline at end of file + self.result.add((fpath, fsize)) + return self.result