Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/host_file_system_creator.py |
| diff --git a/chrome/common/extensions/docs/server2/host_file_system_creator.py b/chrome/common/extensions/docs/server2/host_file_system_creator.py |
| deleted file mode 100644 |
| index cf741058ca9b6bec371bd768c076d0f655fb7902..0000000000000000000000000000000000000000 |
| --- a/chrome/common/extensions/docs/server2/host_file_system_creator.py |
| +++ /dev/null |
| @@ -1,57 +0,0 @@ |
| -# Copyright 2013 The Chromium Authors. All rights reserved. |
|
Jeffrey Yasskin
2013/10/08 17:46:05
Note that this file shows up as an 'M' in rietveld
not at google - send to devlin
2013/10/08 18:27:37
It might be my trying to fiddle with similarity in
|
| -# Use of this source code is governed by a BSD-style license that can be |
| -# found in the LICENSE file. |
| - |
| -from caching_file_system import CachingFileSystem |
| -from local_file_system import LocalFileSystem |
| -from offline_file_system import OfflineFileSystem |
| -from subversion_file_system import SubversionFileSystem |
| - |
| -class HostFileSystemCreator(object): |
| - '''Creates host file systems with configuration information. By default, SVN |
| - file systems are created, although a constructor method can be passed in to |
| - override this behavior (likely for testing purposes). |
| - ''' |
| - def __init__(self, |
| - object_store_creator, |
| - offline=False, |
| - constructor_for_test=None): |
| - self._object_store_creator = object_store_creator |
| - # Determines whether or not created file systems will be wrapped in an |
| - # OfflineFileSystem. |
| - self._offline = offline |
| - # Provides custom create behavior, useful in tests. |
| - self._constructor_for_test = constructor_for_test |
| - |
| - def Create(self, branch='trunk', revision=None, offline=None): |
| - '''Creates either SVN file systems or specialized file systems from the |
| - constructor passed into this instance. Wraps the resulting file system in |
| - an Offline file system if the offline flag is set, and finally wraps it in a |
| - Caching file system. |
| - ''' |
| - if self._constructor_for_test is not None: |
| - file_system = self._constructor_for_test(branch=branch, revision=revision) |
| - else: |
| - file_system = SubversionFileSystem.Create(branch=branch, |
| - revision=revision) |
| - if offline or (offline is None and self._offline): |
| - file_system = OfflineFileSystem(file_system) |
| - return CachingFileSystem(file_system, self._object_store_creator) |
| - |
| - @staticmethod |
| - def ForLocal(object_store_creator): |
| - '''Used in creating a server instance on localhost. |
| - ''' |
| - return HostFileSystemCreator( |
| - object_store_creator, |
| - constructor_for_test=lambda **_: LocalFileSystem.Create()) |
| - |
| - @staticmethod |
| - def ForTest(file_system, object_store_creator): |
| - '''Used in creating a test server instance. The HostFileSystemCreator |
| - returned here will always return |file_system| when its Create() method is |
| - called. |
| - ''' |
| - return HostFileSystemCreator( |
| - object_store_creator, |
| - constructor_for_test=lambda **_: file_system) |