Changed "*.*" to "*" in files.search so it possible find files w/o extension
[findit] / src / files / search.py
index fc6feab..0440610 100755 (executable)
@@ -6,6 +6,7 @@ from os import walk
 from os.path import join, abspath, normcase, isdir, getsize
 from heapq import nlargest
 from fnmatch import fnmatch
+from sys import platform
 
 from misc import size_hum_read, _
 from config import config
@@ -68,9 +69,11 @@ class Abstraction(object):
                 # Store only necessary files
                 for mask in file_filter:
                     if fnmatch(fname, mask):
-                        # Crutch for non-unicode names
-                        #flpath = unicode(join(dirpath, fname), '1251')
-                        flpath = join(dirpath, fname)
+                        if platform == 'win32':
+                            # Crutch for non-unicode names
+                            flpath = unicode(join(dirpath, fname), '1251')
+                        else:
+                            flpath = join(dirpath, fname)
                         # Show current path
                         self.presentation.show_current_status(flpath)
                         # Stop search via 'stopit' signal
@@ -98,7 +101,7 @@ class Cli_Presentation(object):
         try:
             self.file_filter = params[2].split(';')
         except IndexError:
-            self.file_filter = '*.*'
+            self.file_filter = '*'
 
         self.stopit = False
 
@@ -280,7 +283,7 @@ class Gtk_Presentation(object):
         file_filter = self.filter_entry.get_text().split(';')
         # If no filter - show all files
         if file_filter == ['']:
-            file_filter = ['*.*']
+            file_filter = ['*']
         return out, \
             self.path_entry.get_text(), int(self.qty_spin.get_value()), \
             file_filter