From 57f89183bb38f9922adcc3e71fbd114742fc2418 Mon Sep 17 00:00:00 2001 From: hsoft Date: Sun, 7 Jun 2009 07:15:56 +0000 Subject: [PATCH] Mass Rename: CopyOrMove() --> copy_or_move() --HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%4017 --- py/app.py | 4 ++-- py/app_pe_cocoa.py | 4 ++-- py/app_test.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/py/app.py b/py/app.py index 276a879c..387df4e1 100644 --- a/py/app.py +++ b/py/app.py @@ -131,7 +131,7 @@ class DupeGuru(RegistrableApplication): while files.delete_if_empty(path, ['.DS_Store']): path = path[:-1] - def CopyOrMove(self, dupe, copy, destination, dest_type): + def copy_or_move(self, dupe, copy, destination, dest_type): """ copy: True = Copy False = Move destination: string. @@ -164,7 +164,7 @@ class DupeGuru(RegistrableApplication): def do(j): def op(dupe): j.add_progress() - return self.CopyOrMove(dupe, copy, destination, recreate_path) + return self.copy_or_move(dupe, copy, destination, recreate_path) j.start_job(self.results.mark_count) self.last_op_error_count = self.results.perform_on_marked(op, not copy) diff --git a/py/app_pe_cocoa.py b/py/app_pe_cocoa.py index 978b9d43..6e27bb0a 100644 --- a/py/app_pe_cocoa.py +++ b/py/app_pe_cocoa.py @@ -193,10 +193,10 @@ class DupeGuruPE(app_cocoa.DupeGuru): iphotolib.update() return result - def CopyOrMove(self, dupe, copy, destination, dest_type): + def copy_or_move(self, dupe, copy, destination, dest_type): if isinstance(dupe, IPhoto): copy = True - return app_cocoa.DupeGuru.CopyOrMove(self, dupe, copy, destination, dest_type) + return app_cocoa.DupeGuru.copy_or_move(self, dupe, copy, destination, dest_type) def start_scanning(self): for directory in self.directories: diff --git a/py/app_test.py b/py/app_test.py index 9cd732d3..812a0553 100644 --- a/py/app_test.py +++ b/py/app_test.py @@ -57,7 +57,7 @@ class TCDupeGuru(TestCase): call = app.results.apply_filter.calls[5] self.assertEqual('(abc)', call['filter_str']) - def test_CopyOrMove(self): + def test_copy_or_move(self): # The goal here is just to have a test for a previous blowup I had. I know my test coverage # for this unit is pathetic. What's done is done. My approach now is to add tests for # every change I want to make. The blowup was caused by a missing import. @@ -68,13 +68,13 @@ class TCDupeGuru(TestCase): self.mock(os, 'makedirs', lambda path: None) # We don't want the test to create that fake directory self.mock(fs.phys, 'Directory', fs.Directory) # We don't want an error because makedirs didn't work app = DupeGuru() - app.CopyOrMove(dupe, True, 'some_destination', 0) + app.copy_or_move(dupe, True, 'some_destination', 0) self.assertEqual(1, len(hsutil.files.copy.calls)) call = hsutil.files.copy.calls[0] self.assertEqual('some_destination', call['dest_path']) self.assertEqual(dupe.path, call['source_path']) - def test_CopyOrMove_clean_empty_dirs(self): + def test_copy_or_move_clean_empty_dirs(self): tmppath = Path(self.tmpdir()) sourcepath = tmppath + 'source' io.mkdir(sourcepath) @@ -83,7 +83,7 @@ class TCDupeGuru(TestCase): myfile = tmpdir['source']['myfile'] app = DupeGuru() self.mock(app, 'clean_empty_dirs', log_calls(lambda path: None)) - app.CopyOrMove(myfile, False, tmppath + 'dest', 0) + app.copy_or_move(myfile, False, tmppath + 'dest', 0) calls = app.clean_empty_dirs.calls self.assertEqual(1, len(calls)) self.assertEqual(sourcepath, calls[0]['path'])