Ejemplo n.º 1
0
 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()
Ejemplo n.º 2
0
 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()
Ejemplo n.º 3
0
 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()
Ejemplo n.º 4
0
 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()
Ejemplo n.º 5
0
 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()