Initialized a new FileCache instance. If no cache location is specified, a temporary default location will be used. Such default cache location will be shared by all FileCache instances with no explicitly specified location within the same process. The defau
(self, location=None, **duration)
| 133 | units = ('months', 'weeks', 'days', 'hours', 'minutes', 'seconds') |
| 134 | |
| 135 | def __init__(self, location=None, **duration): |
| 136 | """ |
| 137 | Initialized a new FileCache instance. |
| 138 | |
| 139 | If no cache location is specified, a temporary default location will be |
| 140 | used. Such default cache location will be shared by all FileCache |
| 141 | instances with no explicitly specified location within the same |
| 142 | process. The default cache location will be removed automatically on |
| 143 | process exit unless user sets the remove_default_location_on_exit |
| 144 | FileCache class attribute to False. |
| 145 | |
| 146 | @param location: The directory for the cached files. |
| 147 | @type location: str |
| 148 | @param duration: The cached file duration which defines how |
| 149 | long the file will be cached. A duration=0 means forever. |
| 150 | The duration may be: (months|weeks|days|hours|minutes|seconds). |
| 151 | @type duration: {unit:value} |
| 152 | """ |
| 153 | if location is None: |
| 154 | location = self.__get_default_location() |
| 155 | self.location = location |
| 156 | self.duration = (None, 0) |
| 157 | self.setduration(**duration) |
| 158 | self.checkversion() |
| 159 | |
| 160 | def fnsuffix(self): |
| 161 | """ |
nothing calls this directly
no test coverage detected