1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Wrapped data modules around edition-specific core.app subclasses to prepare for data modules removal.

This commit is contained in:
Virgil Dupras
2011-09-20 18:40:27 -04:00
parent f730f4f55a
commit f2164924f7
16 changed files with 384 additions and 370 deletions

View File

@@ -46,10 +46,11 @@ class SysWrapper(io.IOBase):
logging.warning(s)
class DupeGuru(QObject):
MODELCLASS = None
LOGO_NAME = '<replace this>'
NAME = '<replace this>'
def __init__(self, data_module):
def __init__(self):
QObject.__init__(self)
appdata = str(QDesktopServices.storageLocation(QDesktopServices.DataLocation))
if not op.exists(appdata):
@@ -63,7 +64,7 @@ class DupeGuru(QObject):
sys.stdout = SysWrapper()
self.prefs = self._create_preferences()
self.prefs.load()
self.model = DupeGuruModel(view=self, data_module=data_module, appdata=appdata)
self.model = self.MODELCLASS(view=self, appdata=appdata)
self._setup()
#--- Private
@@ -256,11 +257,11 @@ class DupeGuru(QObject):
def reveal_path(path):
DupeGuru.open_path(path[:-1])
def start_job(self, jobid, func, *args):
def start_job(self, jobid, func, args=()):
title = JOBID2TITLE[jobid]
try:
j = self._progress.create_job()
args = tuple([j] + list(args))
args = (j, ) + tuple(args)
self._progress.run(jobid, title, func, args=args)
except job.JobInProgressError:
msg = trmsg("TaskHangingMsg")