Moved filessearch parameters from main to files.search
[findit] / src / files / search.py
index 6a85191..fc6feab 100755 (executable)
@@ -21,8 +21,8 @@ OUTTYPES = [
 
 class Control(object):
 
-    def __init__(self, ui, params):
-        self.present = eval(ui + '_Presentation(self.start_search, params)')
+    def __init__(self, ui, outtype, params):
+        self.present = eval(ui + '_Presentation(self.start_search, outtype, params)')
         self.abstrac = Abstraction(self.present)
 
         self.toplevel = self.present.toplevel
@@ -89,13 +89,17 @@ class Abstraction(object):
 #==============================================================================
 
 class Cli_Presentation(object):
-    def __init__(self, start_func, params):
+    def __init__(self, start_func, outtype, params):
         self.start_func = start_func
 
-        self.outtype = params['outtype']
-        self.start_path = params['start_path']
-        self.count = params['count']
-        self.file_filter = params['file_filter'].split(';')
+        self.outtype = outtype
+        self.start_path = params[0]
+        self.count = params[1]
+        try:
+            self.file_filter = params[2].split(';')
+        except IndexError:
+            self.file_filter = '*.*'
+
         self.stopit = False
 
         self.toplevel = None
@@ -128,7 +132,7 @@ class Cli_Presentation(object):
 
 class Gtk_Presentation(object):
 
-    def __init__(self, start_func, __):
+    def __init__(self, start_func, *unused):
         import gtk
         global gtk  # for show_current_status()
         from misc import NotebookWCloseBtns