diff --git a/pe/cocoa/py/dg_cocoa.py b/pe/cocoa/py/dg_cocoa.py index aa2131d1..66e1ec01 100644 --- a/pe/cocoa/py/dg_cocoa.py +++ b/pe/cocoa/py/dg_cocoa.py @@ -12,7 +12,7 @@ from dupeguru_pe import app_cocoa as app_pe_cocoa # Fix py2app imports which chokes on relative imports from dupeguru import app, app_cocoa, data, directories, engine, export, ignore, results, scanner from dupeguru_pe import block, cache, matchbase, data -from hsfs import auto, manual, stats, tree, utils +from hsfs import auto, stats, tree class PyApp(NSObject): pass #fake class diff --git a/pe/py/app_cocoa.py b/pe/py/app_cocoa.py index 1e5fbd1c..249c6966 100644 --- a/pe/py/app_cocoa.py +++ b/pe/py/app_cocoa.py @@ -34,31 +34,20 @@ PictureBlocks = mainBundle.classNamed_('PictureBlocks') assert PictureBlocks is not None class Photo(phys.File): - cls_info_map = { - 'size': fs.IT_ATTRS, - 'ctime': fs.IT_ATTRS, - 'mtime': fs.IT_ATTRS, - 'md5': fs.IT_MD5, - 'md5partial': fs.IT_MD5, - 'dimensions': fs.IT_EXTRA, - } + INITIAL_INFO = phys.File.INITIAL_INFO.copy() + INITIAL_INFO.update({ + 'dimensions': (0,0), + }) - def _initialize_info(self,section): - super(Photo, self)._initialize_info(section) - if section == fs.IT_EXTRA: - self._info.update({ - 'dimensions': (0,0), - }) - - def _read_info(self,section): - super(Photo, self)._read_info(section) - if section == fs.IT_EXTRA: + def _read_info(self, field): + super(Photo, self)._read_info(field) + if field == 'dimensions': size = PictureBlocks.getImageSize_(unicode(self.path)) - self._info['dimensions'] = (size.width, size.height) + self.dimensions = (size.width, size.height) def get_blocks(self, block_count_per_side): try: - blocks = PictureBlocks.getBlocksFromImagePath_blockCount_scanArea_(unicode(self.path), block_count_per_side, 0) + blocks = PictureBlocks.getBlocksFromImagePath_blockCount_(unicode(self.path), block_count_per_side) except Exception, e: raise IOError('The reading of "%s" failed with "%s"' % (unicode(self.path), unicode(e))) if not blocks: