mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
[#132 state:fixed] Added a debug mode preference as well as extra debug loggings.
This commit is contained in:
@@ -48,7 +48,8 @@ class DupeGuru(DupeGuruBase, QObject):
|
||||
if not op.exists(appdata):
|
||||
os.makedirs(appdata)
|
||||
# For basicConfig() to work, we have to be sure that no logging has taken place before this call.
|
||||
logging.basicConfig(filename=op.join(appdata, 'debug.log'), level=logging.WARNING)
|
||||
logging.basicConfig(filename=op.join(appdata, 'debug.log'), level=logging.WARNING,
|
||||
format='%(asctime)s - %(levelname)s - %(message)s')
|
||||
self.prefs = self._create_preferences()
|
||||
self.prefs.load()
|
||||
DupeGuruBase.__init__(self, data_module, appdata)
|
||||
|
||||
@@ -27,6 +27,7 @@ class Preferences(PreferencesBase):
|
||||
self.ignore_hardlink_matches = get('IgnoreHardlinkMatches', self.ignore_hardlink_matches)
|
||||
self.use_regexp = get('UseRegexp', self.use_regexp)
|
||||
self.remove_empty_folders = get('RemoveEmptyFolders', self.remove_empty_folders)
|
||||
self.debug_mode = get('DebugMode', self.debug_mode)
|
||||
self.destination_type = get('DestinationType', self.destination_type)
|
||||
self.custom_command = get('CustomCommand', self.custom_command)
|
||||
self.language = get('Language', self.language)
|
||||
@@ -59,6 +60,7 @@ class Preferences(PreferencesBase):
|
||||
self.use_regexp = False
|
||||
self.ignore_hardlink_matches = False
|
||||
self.remove_empty_folders = False
|
||||
self.debug_mode = False
|
||||
self.destination_type = 1
|
||||
self.custom_command = ''
|
||||
self.language = ''
|
||||
@@ -89,6 +91,7 @@ class Preferences(PreferencesBase):
|
||||
set_('IgnoreHardlinkMatches', self.ignore_hardlink_matches)
|
||||
set_('UseRegexp', self.use_regexp)
|
||||
set_('RemoveEmptyFolders', self.remove_empty_folders)
|
||||
set_('DebugMode', self.debug_mode)
|
||||
set_('DestinationType', self.destination_type)
|
||||
set_('CustomCommand', self.custom_command)
|
||||
set_('ColumnsWidth', self.columns_width)
|
||||
|
||||
@@ -131,6 +131,7 @@ class PreferencesDialogBase(QDialog):
|
||||
setchecked(self.useRegexpBox, prefs.use_regexp)
|
||||
setchecked(self.removeEmptyFoldersBox, prefs.remove_empty_folders)
|
||||
setchecked(self.ignoreHardlinkMatches, prefs.ignore_hardlink_matches)
|
||||
setchecked(self.debugModeBox, prefs.debug_mode)
|
||||
self.copyMoveDestinationComboBox.setCurrentIndex(prefs.destination_type)
|
||||
self.customCommandEdit.setText(prefs.custom_command)
|
||||
langindex = {'fr': 1}.get(self.app.prefs.language, 0)
|
||||
@@ -145,6 +146,7 @@ class PreferencesDialogBase(QDialog):
|
||||
prefs.use_regexp = ischecked(self.useRegexpBox)
|
||||
prefs.remove_empty_folders = ischecked(self.removeEmptyFoldersBox)
|
||||
prefs.ignore_hardlink_matches = ischecked(self.ignoreHardlinkMatches)
|
||||
prefs.debug_mode = ischecked(self.debugModeBox)
|
||||
prefs.destination_type = self.copyMoveDestinationComboBox.currentIndex()
|
||||
prefs.custom_command = str(self.customCommandEdit.text())
|
||||
langs = ['en', 'fr']
|
||||
|
||||
Reference in New Issue
Block a user