OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 | 6 |
7 class FileNotFoundError(Exception): | 7 class FileNotFoundError(Exception): |
8 def __init__(self, filename): | 8 def __init__(self, filename): |
9 Exception.__init__(self, filename) | 9 Exception.__init__(self, filename) |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 return self.Read([path], binary=binary).Get()[path] | 56 return self.Read([path], binary=binary).Get()[path] |
57 | 57 |
58 # TODO(cduvall): Allow Stat to take a list of paths like Read. | 58 # TODO(cduvall): Allow Stat to take a list of paths like Read. |
59 def Stat(self, path): | 59 def Stat(self, path): |
60 '''Returns a |StatInfo| object containing the version of |path|. If |path| | 60 '''Returns a |StatInfo| object containing the version of |path|. If |path| |
61 is a directory, |StatInfo| will have the versions of all the children of | 61 is a directory, |StatInfo| will have the versions of all the children of |
62 the directory in |StatInfo.child_versions|. | 62 the directory in |StatInfo.child_versions|. |
63 ''' | 63 ''' |
64 raise NotImplementedError() | 64 raise NotImplementedError() |
65 | 65 |
66 def GetVersion(self): | 66 @classmethod |
| 67 def GetName(cls): |
| 68 '''The type of the file system, exposed for caching classes to namespace |
| 69 their caches. It is unlikely that this needs to be overridden. |
| 70 ''' |
| 71 return cls.__name__ |
| 72 |
| 73 @classmethod |
| 74 def GetVersion(cls): |
67 '''The version of the file system, exposed for caching classes backed to | 75 '''The version of the file system, exposed for caching classes backed to |
68 file systems. This is unlikely to change. | 76 file systems. It is unlikely that this needs to be overridden. |
69 ''' | 77 ''' |
70 return None | 78 return None |
OLD | NEW |