Added exception when no results to files.search
authorEugene Gagarin <mosfet07@ya.ru>
Wed, 20 May 2009 12:58:57 +0000 (16:58 +0400)
committerEugene Gagarin <mosfet07@ya.ru>
Wed, 20 May 2009 12:58:57 +0000 (16:58 +0400)
src/files/search.py

index 9510194..6a85191 100755 (executable)
@@ -35,6 +35,9 @@ class Control(object):
         for fsize, fpath in nlargest(count, search_func):
             filelist.append([int(fsize), fpath, size_hum_read(fsize)])
 
+        if not filelist:
+            self.present.nothing_founded()
+            return
         results = [filelist, start_path]
         self.present.show_out_toplevel(outtype, results)
 
@@ -115,6 +118,9 @@ class Cli_Presentation(object):
         print '\\' + '\r',
         ### print current_path
 
+    def nothing_founded(self):
+        print _('Nothing founded!')
+
     def run(self):
         self.start_func(self.get_data, self.get_stopit)
 
@@ -283,6 +289,9 @@ class Gtk_Presentation(object):
         self.statusbar.push(self.context_id, current_path)
         gtk.main_iteration()
 
+    def nothing_founded(self):
+        self.statusbar.push(self.context_id, _('Nothing founded!'))
+
     def run(self):
         pass