def init_gui(self): self.options, _, optparser = nametransformer.get_opt_parse(sys.argv) # init glade self.init_widget('mainwindow', self) self.parameters_panel.init_widget(self, optparser, self.options) self.fileview.init_widget(self.mainwindow) self.log.init_widget() # init model self.init_model() ### Init mainwindow self.mainwindow.Title = self.app_title self.mainwindow.SetIconFromFile(self.app_icon_path) self.mainwindow.SetDefaultSize(600, 500) # set up exception handlers src.callbacks.error_handler = \ handlers.get_error_handler_gui(self.log.textview_log.Buffer, nametrans=True) src.callbacks.progress = \ handlers.get_progress_handler_gui(self.label_progress) GLib.ExceptionManager.UnhandledException += \ handlers.get_error_handler_gui(self.log.textview_log.Buffer) GLib.ExceptionManager.UnhandledException -= handlers.error_handler_terminal
pairs = map(lambda it: (it.f, it.g), items) Fs.do_renames(pairs) io.clear_line() def run(self): if self.validate_options(): items = self.nameTransformer.scan_fs() items = self.nameTransformer.process_items(items) if items and self.display_transforms_and_prompt(items): self.perform_renames(items) if __name__ == '__main__': options, args, parser = nametransformer.get_opt_parse(sys.argv) # options that don't need from/to patterns if not args and not any([ options.flag_capitalize, options.flag_lowercase, options.flag_neat, options.flag_neater, options.flag_underscore, options.flag_dirname, options.renseq, options.flag_flatten, ]): parser.print_help() sys.exit(2)