Returns the age of the cached item, in days.
(self, k)
| 117 | raise KeyError, k |
| 118 | |
| 119 | def age(self, k): |
| 120 | """ Returns the age of the cached item, in days. |
| 121 | """ |
| 122 | p = self._hash(k) |
| 123 | return os.path.exists(p) and (date_now() - date_modified(p)).days or 0 |
| 124 | |
| 125 | def clear(self, age=None): |
| 126 | """ Clears all items from the cache (whose age is the given amount of days or older). |