Mass Rename: ApplyFilter() --> apply_filter()

--HG--
extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%4016
This commit is contained in:
hsoft 2009-06-07 07:14:47 +00:00
parent b21257d875
commit 750225d27b
7 changed files with 14 additions and 14 deletions

View File

@ -159,8 +159,8 @@ class DupeGuru(DupeGuruBase, QObject):
self.add_to_ignore_list(dupe)
self.remove_duplicates(duplicates)
def ApplyFilter(self, filter):
DupeGuruBase.ApplyFilter(self, filter)
def apply_filter(self, filter):
DupeGuruBase.apply_filter(self, filter)
self.emit(SIGNAL('resultsChanged()'))
def ask_for_reg_code(self):

View File

@ -156,11 +156,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
if not ok:
return
answer = unicode(answer)
self.app.ApplyFilter(answer)
self.app.apply_filter(answer)
self._last_filter = answer
def cancelFilterTriggered(self):
self.app.ApplyFilter('')
self.app.apply_filter('')
def checkForUpdateTriggered(self):
QProcess.execute('updater.exe', ['/checknow'])

View File

@ -80,7 +80,7 @@ class PyDupeGuru(PyApp):
self.app.AddSelectedToIgnoreList()
def applyFilter_(self, filter):
self.app.ApplyFilter(filter)
self.app.apply_filter(filter)
def deleteMarked(self):
self.app.delete_marked()

View File

@ -85,7 +85,7 @@ class PyDupeGuru(PyApp):
self.app.delete_marked()
def applyFilter_(self, filter):
self.app.ApplyFilter(filter)
self.app.apply_filter(filter)
def makeSelectedReference(self):
self.app.MakeSelectedReference()

View File

@ -119,7 +119,7 @@ class DupeGuru(RegistrableApplication):
if other is not dupe:
self.scanner.ignore_list.Ignore(unicode(other.path), unicode(dupe.path))
def ApplyFilter(self, filter):
def apply_filter(self, filter):
self.results.apply_filter(None)
if self.options['escape_filter_regexp']:
filter = escape(filter, '()[]\\.|+?^')

View File

@ -33,27 +33,27 @@ class DupeGuru(DupeGuruBase):
class TCDupeGuru(TestCase):
cls_tested_module = app
def test_ApplyFilter_calls_results_apply_filter(self):
def test_apply_filter_calls_results_apply_filter(self):
app = DupeGuru()
self.mock(app.results, 'apply_filter', log_calls(app.results.apply_filter))
app.ApplyFilter('foo')
app.apply_filter('foo')
self.assertEqual(2, len(app.results.apply_filter.calls))
call = app.results.apply_filter.calls[0]
self.assert_(call['filter_str'] is None)
call = app.results.apply_filter.calls[1]
self.assertEqual('foo', call['filter_str'])
def test_ApplyFilter_escapes_regexp(self):
def test_apply_filter_escapes_regexp(self):
app = DupeGuru()
self.mock(app.results, 'apply_filter', log_calls(app.results.apply_filter))
app.ApplyFilter('()[]\\.|+?^abc')
app.apply_filter('()[]\\.|+?^abc')
call = app.results.apply_filter.calls[1]
self.assertEqual('\\(\\)\\[\\]\\\\\\.\\|\\+\\?\\^abc', call['filter_str'])
app.ApplyFilter('(*)') # In "simple mode", we want the * to behave as a wilcard
app.apply_filter('(*)') # In "simple mode", we want the * to behave as a wilcard
call = app.results.apply_filter.calls[3]
self.assertEqual('\(.*\)', call['filter_str'])
app.options['escape_filter_regexp'] = False
app.ApplyFilter('(abc)')
app.apply_filter('(abc)')
call = app.results.apply_filter.calls[5]
self.assertEqual('(abc)', call['filter_str'])

View File

@ -82,7 +82,7 @@ class PyDupeGuru(PyApp):
self.app.delete_marked()
def applyFilter_(self, filter):
self.app.ApplyFilter(filter)
self.app.apply_filter(filter)
def makeSelectedReference(self):
self.app.MakeSelectedReference()