Drop WorkbenchManager.localized_file()
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Tue, 14 Jun 2011 18:01:39 +0000 (20:01 +0200)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Tue, 14 Jun 2011 18:01:39 +0000 (20:01 +0200)
As Workbench has the localized_file() method, use this
everywhere and drop the wrapper method from
WorkbenchManager.

The processing code already did that.

mediagoblin/tests/test_workbench.py
mediagoblin/workbench.py

index 2795cd632b915456de04872c54a5099e042d1935..db27dfc6f735b3d58b52ad066897e4d085f815f9 100644 (file)
@@ -83,20 +83,19 @@ class TestWorkbench(object):
         with this_storage.get_file(filepath, 'w') as our_file:
             our_file.write('Our file')
 
-        filename = self.workbench_manager.localized_file(
-            this_workbench, this_storage, filepath)
+        filename = this_workbench.localized_file(this_storage, filepath)
         assert filename == os.path.join(
             this_workbench.dir, 'ourfile.txt')
         
         # fake remote file storage, filename_if_copying set
-        filename = self.workbench_manager.localized_file(
-            this_workbench, this_storage, filepath, 'thisfile')
+        filename = this_workbench.localized_file(
+            this_storage, filepath, 'thisfile')
         assert filename == os.path.join(
             this_workbench.dir, 'thisfile.txt')
 
         # fake remote file storage, filename_if_copying set,
         # keep_extension_if_copying set to false
-        filename = self.workbench_manager.localized_file(
-            this_workbench, this_storage, filepath, 'thisfile.text', False)
+        filename = this_workbench.localized_file(
+            this_storage, filepath, 'thisfile.text', False)
         assert filename == os.path.join(
             this_workbench.dir, 'thisfile.text')
index c88b686cdc62c3a3ddba977a8c8515496d4f997f..32229d2e3b9ae8d20f659e3236232533704e1a4f 100644 (file)
@@ -151,6 +151,3 @@ class WorkbenchManager(object):
                 "Can't destroy workbench outside the base workbench dir")
 
         shutil.rmtree(workbench)
-
-    def localized_file(self, workbench, *args, **kwargs):
-        return workbench.localized_file(*args, **kwargs)