1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-03-10 05:34:36 +00:00

pe py: Adjusted the code to its move from 'base/py'

--HG--
extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%4080
This commit is contained in:
hsoft 2009-06-18 19:42:27 +00:00
parent fdd7967962
commit 72bdb4258a
6 changed files with 42 additions and 61 deletions

View File

@ -1,13 +1,9 @@
#!/usr/bin/env python # Unit Name: dupeguru_pe.app_cocoa
""" # Created By: Virgil Dupras
Unit Name: dupeguru.app_pe_cocoa # Created On: 2006/11/13
Created By: Virgil Dupras # $Id$
Created On: 2006/11/13 # Copyright 2009 Hardcoded Software (http://www.hardcoded.net)
Last modified by:$Author: virgil $
Last modified on:$Date: 2009-05-28 16:33:32 +0200 (Thu, 28 May 2009) $
$Revision: 4392 $
Copyright 2006 Hardcoded Software (http://www.hardcoded.net)
"""
import os import os
import os.path as op import os.path as op
import logging import logging
@ -26,8 +22,9 @@ from hsutil.str import get_file_ext
from hsutil.path import Path from hsutil.path import Path
from hsutil.cocoa import as_fetch from hsutil.cocoa import as_fetch
import app_cocoa, data_pe, directories, picture.matchbase from dupeguru import app_cocoa, directories
from picture.cache import string_to_colors, Cache from . import data, matchbase
from .cache import string_to_colors, Cache
mainBundle = NSBundle.mainBundle() mainBundle = NSBundle.mainBundle()
PictureBlocks = mainBundle.classNamed_('PictureBlocks') PictureBlocks = mainBundle.classNamed_('PictureBlocks')
@ -123,8 +120,8 @@ class IPhotoLibrary(fs.Directory):
class DupeGuruPE(app_cocoa.DupeGuru): class DupeGuruPE(app_cocoa.DupeGuru):
def __init__(self): def __init__(self):
app_cocoa.DupeGuru.__init__(self, data_pe, 'dupeguru_pe', appid=5) app_cocoa.DupeGuru.__init__(self, data, 'dupeguru_pe', appid=5)
self.scanner.match_factory = picture.matchbase.AsyncMatchFactory() self.scanner.match_factory = matchbase.AsyncMatchFactory()
self.directories.dirclass = Directory self.directories.dirclass = Directory
self.directories.special_dirclasses[Path('iPhoto Library')] = lambda _, __: self._create_iphoto_library() self.directories.special_dirclasses[Path('iPhoto Library')] = lambda _, __: self._create_iphoto_library()
p = op.join(self.appdata, 'cached_pictures.db') p = op.join(self.appdata, 'cached_pictures.db')

View File

@ -1,13 +1,9 @@
#!/usr/bin/env python # Unit Name: dupeguru_pe.block
""" # Created By: Virgil Dupras
Unit Name: hs.picture.block # Created On: 2006/09/01
Created By: Virgil Dupras # $Id$
Created On: 2006/09/01 # Copyright 2009 Hardcoded Software (http://www.hardcoded.net)
Last modified by:$Author: virgil $
Last modified on:$Date: 2009-05-26 18:12:39 +0200 (Tue, 26 May 2009) $
$Revision: 4365 $
Copyright 2004-2006 Hardcoded Software (http://www.hardcoded.net)
"""
from _block import NoBlocksError, DifferentBlockCountError, avgdiff, getblocks2 from _block import NoBlocksError, DifferentBlockCountError, avgdiff, getblocks2
# Converted to Cython # Converted to Cython

View File

@ -1,13 +1,9 @@
#!/usr/bin/env python # Unit Name: dupeguru_pe.cache
""" # Created By: Virgil Dupras
Unit Name: hs.picture.cache # Created On: 2006/09/14
Created By: Virgil Dupras # $Id$
Created On: 2006/09/14 # Copyright 2009 Hardcoded Software (http://www.hardcoded.net)
Last modified by:$Author: virgil $
Last modified on:$Date: 2009-05-28 16:33:32 +0200 (Thu, 28 May 2009) $
$Revision: 4392 $
Copyright 2004-2006 Hardcoded Software (http://www.hardcoded.net)
"""
import os import os
import logging import logging
import sqlite3 as sqlite import sqlite3 as sqlite

View File

@ -1,15 +1,11 @@
#!/usr/bin/env python # Unit Name: dupeguru_pe.data
""" # Created By: Virgil Dupras
Unit Name: dupeguru.data # Created On: 2006/03/15
Created By: Virgil Dupras # $Id$
Created On: 2006/03/15 # Copyright 2009 Hardcoded Software (http://www.hardcoded.net)
Last modified by:$Author: virgil $
Last modified on:$Date: 2009-05-28 15:22:39 +0200 (Thu, 28 May 2009) $
$Revision: 4385 $
Copyright 2004-2006 Hardcoded Software (http://www.hardcoded.net)
"""
from hsutil.str import format_size from hsutil.str import format_size
from .data import format_path, format_timestamp, format_perc, format_dupe_count, cmp_value from dupeguru.data import format_path, format_timestamp, format_perc, format_dupe_count, cmp_value
def format_dimensions(dimensions): def format_dimensions(dimensions):
return '%d x %d' % (dimensions[0], dimensions[1]) return '%d x %d' % (dimensions[0], dimensions[1])

View File

@ -22,7 +22,7 @@ os.system('python setup.py build_ext --inplace')
os.chdir(op.join('..', 'cache')) os.chdir(op.join('..', 'cache'))
os.system('python setup.py build_ext --inplace') os.system('python setup.py build_ext --inplace')
os.chdir(op.join('..', '..')) os.chdir(op.join('..', '..'))
move(op.join('modules', 'block', '_block.so'), '.') move(op.join('modules', 'block', '_block.so'), '_block.so')
move(op.join('modules', 'block', '_block.pyd'), '.') move(op.join('modules', 'block', '_block.pyd'), '_block.pyd')
move(op.join('modules', 'cache', '_cache.so'), '.') move(op.join('modules', 'cache', '_cache.so'), '_cache.so')
move(op.join('modules', 'cache', '_cache.pyd'), '.') move(op.join('modules', 'cache', '_cache.pyd'), '_cache.pyd')

View File

@ -1,13 +1,9 @@
#!/usr/bin/env python # Unit Name: dupeguru_pe.matchbase
""" # Created By: Virgil Dupras
Unit Name: hs.picture._match # Created On: 2007/02/25
Created By: Virgil Dupras # $Id$
Created On: 2007/02/25 # Copyright 2009 Hardcoded Software (http://www.hardcoded.net)
Last modified by:$Author: virgil $
Last modified on:$Date: 2009-05-28 16:02:48 +0200 (Thu, 28 May 2009) $
$Revision: 4388 $
Copyright 2007 Hardcoded Software (http://www.hardcoded.net)
"""
import logging import logging
import multiprocessing import multiprocessing
from Queue import Empty from Queue import Empty
@ -17,8 +13,8 @@ from hsutil import job
from hsutil.misc import dedupe from hsutil.misc import dedupe
from dupeguru.engine import Match from dupeguru.engine import Match
from block import avgdiff, DifferentBlockCountError, NoBlocksError from .block import avgdiff, DifferentBlockCountError, NoBlocksError
from cache import Cache from .cache import Cache
MIN_ITERATIONS = 3 MIN_ITERATIONS = 3