mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Removed a little cross-platform code duplication in core_me and core_pe.
This commit is contained in:
parent
0da1947902
commit
f0441db88a
@ -12,6 +12,7 @@ from core.app import (DupeGuru as DupeGuruBase, Column, format_timestamp,
|
|||||||
format_perc, format_words, format_dupe_count, cmp_value)
|
format_perc, format_words, format_dupe_count, cmp_value)
|
||||||
from . import prioritize
|
from . import prioritize
|
||||||
from . import __appname__
|
from . import __appname__
|
||||||
|
from . import scanner, fs
|
||||||
|
|
||||||
tr = lambda s: trbase(s, 'columns')
|
tr = lambda s: trbase(s, 'columns')
|
||||||
|
|
||||||
@ -45,6 +46,8 @@ class DupeGuru(DupeGuruBase):
|
|||||||
|
|
||||||
def __init__(self, view, appdata):
|
def __init__(self, view, appdata):
|
||||||
DupeGuruBase.__init__(self, view, appdata)
|
DupeGuruBase.__init__(self, view, appdata)
|
||||||
|
self.scanner = scanner.ScannerME()
|
||||||
|
self.directories.fileclasses = [fs.MusicFile]
|
||||||
|
|
||||||
def _get_display_info(self, dupe, group, delta):
|
def _get_display_info(self, dupe, group, delta):
|
||||||
size = dupe.size
|
size = dupe.size
|
||||||
|
@ -17,7 +17,6 @@ from hscommon.trans import tr
|
|||||||
from core.app import JobType
|
from core.app import JobType
|
||||||
from core.app_cocoa import JOBID2TITLE
|
from core.app_cocoa import JOBID2TITLE
|
||||||
|
|
||||||
from . import scanner, fs
|
|
||||||
from .app import DupeGuru as DupeGuruBase
|
from .app import DupeGuru as DupeGuruBase
|
||||||
|
|
||||||
JobType.RemoveDeadTracks = 'jobRemoveDeadTracks'
|
JobType.RemoveDeadTracks = 'jobRemoveDeadTracks'
|
||||||
@ -32,8 +31,6 @@ class DupeGuruME(DupeGuruBase):
|
|||||||
def __init__(self, view, appdata):
|
def __init__(self, view, appdata):
|
||||||
appdata = op.join(appdata, 'dupeGuru Music Edition')
|
appdata = op.join(appdata, 'dupeGuru Music Edition')
|
||||||
DupeGuruBase.__init__(self, view, appdata)
|
DupeGuruBase.__init__(self, view, appdata)
|
||||||
self.scanner = scanner.ScannerME()
|
|
||||||
self.directories.fileclasses = [fs.MusicFile]
|
|
||||||
self.dead_tracks = []
|
self.dead_tracks = []
|
||||||
|
|
||||||
def remove_dead_tracks(self):
|
def remove_dead_tracks(self):
|
||||||
|
@ -5,11 +5,14 @@
|
|||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
|
||||||
|
import os.path as op
|
||||||
|
|
||||||
from hscommon.trans import tr as trbase
|
from hscommon.trans import tr as trbase
|
||||||
from hscommon.util import format_size
|
from hscommon.util import format_size
|
||||||
|
|
||||||
from core.app import (DupeGuru as DupeGuruBase, Column, format_timestamp, format_perc,
|
from core.app import (DupeGuru as DupeGuruBase, Column, format_timestamp, format_perc,
|
||||||
format_dupe_count, cmp_value)
|
format_dupe_count, cmp_value)
|
||||||
|
from .scanner import ScannerPE
|
||||||
from . import prioritize
|
from . import prioritize
|
||||||
from . import __appname__
|
from . import __appname__
|
||||||
|
|
||||||
@ -41,6 +44,8 @@ class DupeGuru(DupeGuruBase):
|
|||||||
|
|
||||||
def __init__(self, view, appdata):
|
def __init__(self, view, appdata):
|
||||||
DupeGuruBase.__init__(self, view, appdata)
|
DupeGuruBase.__init__(self, view, appdata)
|
||||||
|
self.scanner = ScannerPE()
|
||||||
|
self.scanner.cache_path = op.join(self.appdata, 'cached_pictures.db')
|
||||||
|
|
||||||
def _get_display_info(self, dupe, group, delta):
|
def _get_display_info(self, dupe, group, delta):
|
||||||
size = dupe.size
|
size = dupe.size
|
||||||
|
@ -22,7 +22,6 @@ from hscommon.trans import tr
|
|||||||
from core import directories
|
from core import directories
|
||||||
from . import _block_osx
|
from . import _block_osx
|
||||||
from .photo import Photo as PhotoBase
|
from .photo import Photo as PhotoBase
|
||||||
from .scanner import ScannerPE
|
|
||||||
from .app import DupeGuru as DupeGuruBase
|
from .app import DupeGuru as DupeGuruBase
|
||||||
|
|
||||||
IPHOTO_PATH = Path('iPhoto Library')
|
IPHOTO_PATH = Path('iPhoto Library')
|
||||||
@ -133,9 +132,7 @@ class DupeGuruPE(DupeGuruBase):
|
|||||||
def __init__(self, view, appdata):
|
def __init__(self, view, appdata):
|
||||||
appdata = op.join(appdata, 'dupeGuru Picture Edition')
|
appdata = op.join(appdata, 'dupeGuru Picture Edition')
|
||||||
DupeGuruBase.__init__(self, view, appdata)
|
DupeGuruBase.__init__(self, view, appdata)
|
||||||
self.scanner = ScannerPE()
|
|
||||||
self.directories = Directories()
|
self.directories = Directories()
|
||||||
self.scanner.cache_path = op.join(self.appdata, 'cached_pictures.db')
|
|
||||||
|
|
||||||
def _do_delete(self, j, replace_with_hardlinks):
|
def _do_delete(self, j, replace_with_hardlinks):
|
||||||
def op(dupe):
|
def op(dupe):
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
|
||||||
from core_me import scanner, fs, __appname__
|
from core_me import __appname__
|
||||||
from core_me.app import DupeGuru as DupeGuruModel
|
from core_me.app import DupeGuru as DupeGuruModel
|
||||||
|
|
||||||
from ..base.app import DupeGuru as DupeGuruBase
|
from ..base.app import DupeGuru as DupeGuruBase
|
||||||
@ -20,11 +20,6 @@ class DupeGuru(DupeGuruBase):
|
|||||||
LOGO_NAME = 'logo_me'
|
LOGO_NAME = 'logo_me'
|
||||||
NAME = __appname__
|
NAME = __appname__
|
||||||
|
|
||||||
def _setup(self):
|
|
||||||
self.model.scanner = scanner.ScannerME()
|
|
||||||
self.model.directories.fileclasses = [fs.MusicFile]
|
|
||||||
DupeGuruBase._setup(self)
|
|
||||||
|
|
||||||
def _update_options(self):
|
def _update_options(self):
|
||||||
DupeGuruBase._update_options(self)
|
DupeGuruBase._update_options(self)
|
||||||
self.model.scanner.min_match_percentage = self.prefs.filter_hardness
|
self.model.scanner.min_match_percentage = self.prefs.filter_hardness
|
||||||
|
@ -6,14 +6,12 @@
|
|||||||
# which should be included with this package. The terms are also available at
|
# which should be included with this package. The terms are also available at
|
||||||
# http://www.hardcoded.net/licenses/bsd_license
|
# http://www.hardcoded.net/licenses/bsd_license
|
||||||
|
|
||||||
import os.path as op
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt4.QtGui import QImage, QImageReader, QTransform
|
from PyQt4.QtGui import QImage, QImageReader, QTransform
|
||||||
|
|
||||||
from core_pe import __appname__
|
from core_pe import __appname__
|
||||||
from core_pe.photo import Photo as PhotoBase
|
from core_pe.photo import Photo as PhotoBase
|
||||||
from core_pe.scanner import ScannerPE
|
|
||||||
from core_pe.app import DupeGuru as DupeGuruModel
|
from core_pe.app import DupeGuru as DupeGuruModel
|
||||||
|
|
||||||
from ..base.app import DupeGuru as DupeGuruBase
|
from ..base.app import DupeGuru as DupeGuruBase
|
||||||
@ -73,9 +71,7 @@ class DupeGuru(DupeGuruBase):
|
|||||||
NAME = __appname__
|
NAME = __appname__
|
||||||
|
|
||||||
def _setup(self):
|
def _setup(self):
|
||||||
self.model.scanner = ScannerPE()
|
|
||||||
self.model.directories.fileclasses = [File]
|
self.model.directories.fileclasses = [File]
|
||||||
self.model.scanner.cache_path = op.join(self.model.appdata, 'cached_pictures.db')
|
|
||||||
DupeGuruBase._setup(self)
|
DupeGuruBase._setup(self)
|
||||||
|
|
||||||
def _update_options(self):
|
def _update_options(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user