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
#==============================================================================
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
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
parser.add_option('--license', action='callback', callback=self._license)
(options, args) = parser.parse_args()
- self.search = options.search
-
- self.options = {}
- self.options['outtype'] = options.output
- self.options['ignore_dirs'] = config['files']['ignore_dirs']
-
- self.params = options.params.split()
- self.options['start_path'] = self.params[0]
- self.options['count'] = self.params[1]
- try:
- self.options['file_filter'] = self.params[2]
- except IndexError:
- self.options['file_filter'] = '*.*'
+ self.search = options.search
+ self.outtype = options.output
+ self.params = options.params.split()
def _about(self, *a):
print self.abstrac.comments
def show_search_toplevel(self):
search_module = __import__(self.search + '.search')
- search_toplevel = search_module.search.Control('Cli', self.options).run()
+ search_toplevel = search_module.search.Control('Cli', self.outtype, self.params).run()
def run(self):
self.show_search_toplevel()