def __init__(self, view, appdata): if view.get_default(DEBUG_MODE_PREFERENCE): logging.getLogger().setLevel(logging.DEBUG) logging.debug("Debug mode enabled") RegistrableApplication.__init__(self, view, appid=1) Broadcaster.__init__(self) self.appdata = appdata if not op.exists(self.appdata): os.makedirs(self.appdata) self.directories = directories.Directories() self.results = results.Results(self) self.scanner = scanner.Scanner() self.options = { 'escape_filter_regexp': True, 'clean_empty_dirs': False, 'ignore_hardlink_matches': False, 'copymove_dest_type': DestType.Relative, } self.selected_dupes = [] self.details_panel = DetailsPanel(self) self.directory_tree = DirectoryTree(self) self.problem_dialog = ProblemDialog(self) self.ignore_list_dialog = IgnoreListDialog(self) self.stats_label = StatsLabel(self) self.result_table = self._create_result_table() self.deletion_options = DeletionOptions() self.progress_window = ProgressWindow(self._job_completed) children = [self.result_table, self.directory_tree, self.stats_label, self.details_panel] for child in children: child.connect()
def __init__(self, view): if view.get_default(DEBUG_MODE_PREFERENCE): logging.getLogger().setLevel(logging.DEBUG) logging.debug("Debug mode enabled") Broadcaster.__init__(self) self.view = view self.appdata = desktop.special_folder_path( desktop.SpecialFolder.AppData, appname=self.NAME) if not op.exists(self.appdata): os.makedirs(self.appdata) self.directories = directories.Directories() self.results = results.Results(self) self.scanner = self.SCANNER_CLASS() self.options = { 'escape_filter_regexp': True, 'clean_empty_dirs': False, 'ignore_hardlink_matches': False, 'copymove_dest_type': DestType.Relative, } self.selected_dupes = [] self.details_panel = DetailsPanel(self) self.directory_tree = DirectoryTree(self) self.problem_dialog = ProblemDialog(self) self.ignore_list_dialog = IgnoreListDialog(self) self.stats_label = StatsLabel(self) self.result_table = self._create_result_table() self.deletion_options = DeletionOptions() self.progress_window = ProgressWindow(self._job_completed) children = [ self.result_table, self.directory_tree, self.stats_label, self.details_panel ] for child in children: child.connect()
def __init__( self, view, date_format='dd/MM/yyyy', decimal_sep='.', grouping_sep='', default_currency=USD, cache_path=None, appdata_path=None, plugin_model_path=None): Broadcaster.__init__(self) self.view = view self.cache_path = cache_path # cache_path is required, but for tests, we don't want to bother specifying it. When # cache_path is kept as None, the path of the currency db will be ':memory:' if cache_path: if not op.exists(cache_path): os.makedirs(cache_path) db_path = op.join(cache_path, 'currency.db') else: db_path = ':memory:' self.appdata_path = appdata_path currency.initialize_db(db_path) self.is_first_run = not self.get_default(PreferenceNames.HadFirstLaunch, False) if self.is_first_run: self.set_default(PreferenceNames.HadFirstLaunch, True) self._default_currency = default_currency self._date_format = date_format self._decimal_sep = decimal_sep self._grouping_sep = grouping_sep self._autosave_timer = None self._autosave_interval = self.get_default(PreferenceNames.AutoSaveInterval, 10) self._auto_decimal_place = self.get_default(PreferenceNames.AutoDecimalPlace, False) self._show_schedule_scope_dialog = self.get_default(PreferenceNames.ShowScheduleScopeDialog, True) self.saved_custom_ranges = [None] * 3 self._load_custom_ranges() self._load_plugins(plugin_model_path) self._hook_currency_plugins() self._update_autosave_timer()
def __init__(self, view, date_format='dd/MM/yyyy', decimal_sep='.', grouping_sep='', default_currency=USD, cache_path=None, appdata_path=None): Broadcaster.__init__(self) self.view = view self.cache_path = cache_path # cache_path is required, but for tests, we don't want to bother specifying it. When # cache_path is kept as None, the path of the currency db will be ':memory:' if cache_path: if not op.exists(cache_path): os.makedirs(cache_path) db_path = op.join(cache_path, 'currency.db') else: db_path = ':memory:' self.appdata_path = appdata_path if appdata_path and not op.exists(appdata_path): os.makedirs(appdata_path) currency.initialize_db(db_path) self.is_first_run = not self.get_default( PreferenceNames.HadFirstLaunch, False) if self.is_first_run: self.set_default(PreferenceNames.HadFirstLaunch, True) self._default_currency = default_currency self._date_format = date_format self._decimal_sep = decimal_sep self._grouping_sep = grouping_sep self._autosave_timer = None self._autosave_interval = self.get_default( PreferenceNames.AutoSaveInterval, 10) self._auto_decimal_place = self.get_default( PreferenceNames.AutoDecimalPlace, False) self._day_first_date_entry = self.get_default( PreferenceNames.DayFirstDateEntry, True) self._show_schedule_scope_dialog = self.get_default( PreferenceNames.ShowScheduleScopeDialog, True) self.saved_custom_ranges = [None] * 3 self._load_custom_ranges() self.plugins = [] # Plugins with ENABLED_BY_DEFAULT = True are implicitly enabled and must be explicitly # disabled. self._disabled_plugins = set( self.get_default(PreferenceNames.DisabledCorePlugins, [])) # User plugins are disabled by default. self._enabled_plugins = set( self.get_default(PreferenceNames.EnabledUserPlugins, [])) self._load_core_plugins() self._load_user_plugins() self._hook_currency_plugins() self._update_autosave_timer() self._update_date_entry_order()
def __init__(self, view): Broadcaster.__init__(self) self.view = view self.current_path = None self._hide_ignored = False self.selected_elements = set() self.pages = [] self.elements = [] self.last_file_was_invalid = False self.element_table = ElementTable(self) self.opened_file_label = OpenedFileLabel(self) self.page_controller = PageController(self) self.build_pane = BuildPane(self) self.edit_pane = EditPane(self)
def __init__(self, view, portable=False): if view.get_default(DEBUG_MODE_PREFERENCE): logging.getLogger().setLevel(logging.DEBUG) logging.debug("Debug mode enabled") Broadcaster.__init__(self) self.view = view self.appdata = desktop.special_folder_path( desktop.SpecialFolder.APPDATA, appname=self.NAME, portable=portable) if not op.exists(self.appdata): os.makedirs(self.appdata) self.app_mode = AppMode.STANDARD self.discarded_file_count = 0 self.exclude_list = ExcludeList() hash_cache_file = op.join(self.appdata, "hash_cache.db") fs.filesdb.connect(hash_cache_file) self.directories = directories.Directories(self.exclude_list) self.results = results.Results(self) self.ignore_list = IgnoreList() # In addition to "app-level" options, this dictionary also holds options that will be # sent to the scanner. They don't have default values because those defaults values are # defined in the scanner class. self.options = { "escape_filter_regexp": True, "clean_empty_dirs": False, "ignore_hardlink_matches": False, "copymove_dest_type": DestType.RELATIVE, "picture_cache_type": self.PICTURE_CACHE_TYPE, } self.selected_dupes = [] self.details_panel = DetailsPanel(self) self.directory_tree = DirectoryTree(self) self.problem_dialog = ProblemDialog(self) self.ignore_list_dialog = IgnoreListDialog(self) self.exclude_list_dialog = ExcludeListDialogCore(self) self.stats_label = StatsLabel(self) self.result_table = None self.deletion_options = DeletionOptions() self.progress_window = ProgressWindow(self._job_completed, self._job_error) children = [self.directory_tree, self.stats_label, self.details_panel] for child in children: child.connect()
def __init__( self, view, date_format='dd/MM/yyyy', decimal_sep='.', grouping_sep='', default_currency=USD, cache_path=None, appdata_path=None): Broadcaster.__init__(self) self.view = view self.cache_path = cache_path # cache_path is required, but for tests, we don't want to bother specifying it. When # cache_path is kept as None, the path of the currency db will be ':memory:' if cache_path: if not op.exists(cache_path): os.makedirs(cache_path) db_path = op.join(cache_path, 'currency.db') else: db_path = ':memory:' self.appdata_path = appdata_path if appdata_path and not op.exists(appdata_path): os.makedirs(appdata_path) currency.initialize_db(db_path) self.is_first_run = not self.get_default(PreferenceNames.HadFirstLaunch, False) if self.is_first_run: self.set_default(PreferenceNames.HadFirstLaunch, True) self._default_currency = default_currency self._date_format = date_format self._decimal_sep = decimal_sep self._grouping_sep = grouping_sep self._autosave_timer = None self._autosave_interval = self.get_default(PreferenceNames.AutoSaveInterval, 10) self._auto_decimal_place = self.get_default(PreferenceNames.AutoDecimalPlace, False) self._day_first_date_entry = self.get_default(PreferenceNames.DayFirstDateEntry, True) self._show_schedule_scope_dialog = self.get_default(PreferenceNames.ShowScheduleScopeDialog, True) self.saved_custom_ranges = [None] * 3 self._load_custom_ranges() self.plugins = [] # Plugins with ENABLED_BY_DEFAULT = True are implicitly enabled and must be explicitly # disabled. self._disabled_plugins = set(self.get_default(PreferenceNames.DisabledCorePlugins, [])) # User plugins are disabled by default. self._enabled_plugins = set(self.get_default(PreferenceNames.EnabledUserPlugins, [])) self._load_core_plugins() self._load_user_plugins() self._hook_currency_plugins() self._update_autosave_timer() self._update_date_entry_order()
def __init__(self, view): if view.get_default(DEBUG_MODE_PREFERENCE): logging.getLogger().setLevel(logging.DEBUG) logging.debug("Debug mode enabled") Broadcaster.__init__(self) self.view = view self.appdata = desktop.special_folder_path( desktop.SpecialFolder.AppData, appname=self.NAME) if not op.exists(self.appdata): os.makedirs(self.appdata) self.app_mode = AppMode.Standard self.discarded_file_count = 0 self.directories = directories.Directories() self.results = results.Results(self) self.ignore_list = IgnoreList() # In addition to "app-level" options, this dictionary also holds options that will be # sent to the scanner. They don't have default values because those defaults values are # defined in the scanner class. self.options = { 'escape_filter_regexp': True, 'clean_empty_dirs': False, 'ignore_hardlink_matches': False, 'copymove_dest_type': DestType.Relative, 'cache_path': op.join(self.appdata, 'cached_pictures.db'), } self.selected_dupes = [] self.details_panel = DetailsPanel(self) self.directory_tree = DirectoryTree(self) self.problem_dialog = ProblemDialog(self) self.ignore_list_dialog = IgnoreListDialog(self) self.stats_label = StatsLabel(self) self.result_table = None self.deletion_options = DeletionOptions() self.progress_window = ProgressWindow(self._job_completed, self._job_error) children = [self.directory_tree, self.stats_label, self.details_panel] for child in children: child.connect()
def __init__(self, view): if view.get_default(DEBUG_MODE_PREFERENCE): logging.getLogger().setLevel(logging.DEBUG) logging.debug("Debug mode enabled") Broadcaster.__init__(self) self.view = view self.appdata = desktop.special_folder_path(desktop.SpecialFolder.AppData, appname=self.NAME) if not op.exists(self.appdata): os.makedirs(self.appdata) self.discarded_file_count = 0 self.fileclasses = [fs.File] self.folderclass = fs.Folder self.directories = directories.Directories() self.results = results.Results(self) self.ignore_list = IgnoreList() # In addition to "app-level" options, this dictionary also holds options that will be # sent to the scanner. They don't have default values because those defaults values are # defined in the scanner class. self.options = { 'escape_filter_regexp': True, 'clean_empty_dirs': False, 'ignore_hardlink_matches': False, 'copymove_dest_type': DestType.Relative, } self.selected_dupes = [] self.details_panel = DetailsPanel(self) self.directory_tree = DirectoryTree(self) self.problem_dialog = ProblemDialog(self) self.ignore_list_dialog = IgnoreListDialog(self) self.stats_label = StatsLabel(self) self.result_table = self._create_result_table() self.deletion_options = DeletionOptions() self.progress_window = ProgressWindow(self._job_completed) children = [self.result_table, self.directory_tree, self.stats_label, self.details_panel] for child in children: child.connect()
def __init__(self): Plugin.__init__(self) Broadcaster.__init__(self)