2010-01-01 20:11:34 +00:00
|
|
|
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
|
2009-08-05 08:59:46 +00:00
|
|
|
#
|
|
|
|
# This software is licensed under the "HS" License as described in the "LICENSE" file,
|
|
|
|
# which should be included with this package. The terms are also available at
|
|
|
|
# http://www.hardcoded.net/licenses/hs_license
|
|
|
|
|
2010-02-04 12:20:38 +00:00
|
|
|
from hsutil.cocoa import signature
|
2009-06-01 09:55:11 +00:00
|
|
|
|
2009-12-30 10:37:57 +00:00
|
|
|
from core import scanner
|
2010-02-05 19:10:54 +00:00
|
|
|
from core.app_cocoa_inter import PyDupeGuruBase, PyDetailsPanel
|
2010-02-03 10:55:53 +00:00
|
|
|
from core_se.app_cocoa import DupeGuru
|
2009-06-01 09:55:11 +00:00
|
|
|
|
2010-03-01 12:15:27 +00:00
|
|
|
# Fix py2app imports with chokes on relative imports and other stuff
|
2009-12-30 10:37:57 +00:00
|
|
|
from core_se import fs, data
|
2010-03-01 12:15:27 +00:00
|
|
|
from lxml import etree, _elementpath
|
|
|
|
import gzip
|
2009-06-01 09:55:11 +00:00
|
|
|
|
2010-02-03 10:55:53 +00:00
|
|
|
class PyDupeGuru(PyDupeGuruBase):
|
2009-06-01 09:55:11 +00:00
|
|
|
def init(self):
|
|
|
|
self = super(PyDupeGuru,self).init()
|
2010-02-07 14:26:50 +00:00
|
|
|
self.py = DupeGuru()
|
2009-06-01 09:55:11 +00:00
|
|
|
return self
|
|
|
|
|
|
|
|
#---Properties
|
|
|
|
def setMinMatchPercentage_(self,percentage):
|
2010-02-07 14:26:50 +00:00
|
|
|
self.py.scanner.min_match_percentage = int(percentage)
|
2009-06-01 09:55:11 +00:00
|
|
|
|
|
|
|
def setScanType_(self,scan_type):
|
|
|
|
try:
|
2010-02-07 14:26:50 +00:00
|
|
|
self.py.scanner.scan_type = [
|
2009-06-01 09:55:11 +00:00
|
|
|
scanner.SCAN_TYPE_FILENAME,
|
|
|
|
scanner.SCAN_TYPE_CONTENT
|
|
|
|
][scan_type]
|
|
|
|
except IndexError:
|
|
|
|
pass
|
|
|
|
|
|
|
|
def setWordWeighting_(self,words_are_weighted):
|
2010-02-07 14:26:50 +00:00
|
|
|
self.py.scanner.word_weighting = words_are_weighted
|
2009-06-01 09:55:11 +00:00
|
|
|
|
|
|
|
def setMatchSimilarWords_(self,match_similar_words):
|
2010-02-07 14:26:50 +00:00
|
|
|
self.py.scanner.match_similar_words = match_similar_words
|
2009-06-01 09:55:11 +00:00
|
|
|
|
2010-02-04 12:20:38 +00:00
|
|
|
@signature('v@:i')
|
2009-06-01 09:55:11 +00:00
|
|
|
def setSizeThreshold_(self, size_threshold):
|
2010-02-07 14:26:50 +00:00
|
|
|
self.py.scanner.size_threshold = size_threshold
|
2009-06-01 09:55:11 +00:00
|
|
|
|
|
|
|
#---Registration
|
2010-01-13 08:30:10 +00:00
|
|
|
def appName(self):
|
|
|
|
return "dupeGuru"
|
|
|
|
|