projects
/
findit
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f3762ed
)
Added exception when no results to files.search
author
Eugene Gagarin
<mosfet07@ya.ru>
Wed, 20 May 2009 12:58:57 +0000
(16:58 +0400)
committer
Eugene Gagarin
<mosfet07@ya.ru>
Wed, 20 May 2009 12:58:57 +0000
(16:58 +0400)
src/files/search.py
patch
|
blob
|
history
diff --git
a/src/files/search.py
b/src/files/search.py
index
9510194
..
6a85191
100755
(executable)
--- 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)])
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)
results = [filelist, start_path]
self.present.show_out_toplevel(outtype, results)
@@
-115,6
+118,9
@@
class Cli_Presentation(object):
print '\\' + '\r',
### print current_path
print '\\' + '\r',
### print current_path
+ def nothing_founded(self):
+ print _('Nothing founded!')
+
def run(self):
self.start_func(self.get_data, self.get_stopit)
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()
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
def run(self):
pass