Set the caching duration which defines how long the file will be cached. @param duration: The cached file duration which defines how long the file will be cached. A duration=0 means forever. The duration may be: (months|weeks|days|hours|minutes|secon
(self, **duration)
| 166 | return 'gcf' |
| 167 | |
| 168 | def setduration(self, **duration): |
| 169 | """ |
| 170 | Set the caching duration which defines how long the |
| 171 | file will be cached. |
| 172 | @param duration: The cached file duration which defines how |
| 173 | long the file will be cached. A duration=0 means forever. |
| 174 | The duration may be: (months|weeks|days|hours|minutes|seconds). |
| 175 | @type duration: {unit:value} |
| 176 | """ |
| 177 | if len(duration) == 1: |
| 178 | arg = list(duration.items())[0] |
| 179 | if not arg[0] in self.units: |
| 180 | raise Exception('must be: %s' % str(self.units)) |
| 181 | self.duration = arg |
| 182 | return self |
| 183 | |
| 184 | def setlocation(self, location): |
| 185 | """ |