From: Eugene Gagarin Date: Wed, 20 May 2009 12:58:57 +0000 (+0400) Subject: Added exception when no results to files.search X-Git-Url: http://git.maemo.org/git/?p=findit;a=commitdiff_plain;h=50424b0559097b9f165f47d01997782de7501a40 Added exception when no results to files.search --- diff --git a/src/files/search.py b/src/files/search.py index 9510194..6a85191 100755 --- a/src/files/search.py +++ b/src/files/search.py @@ -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