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
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