Returns the data stored with the given id. With unicode=True, returns a Unicode string.
(self, k, unicode=True)
| 104 | pass |
| 105 | |
| 106 | def get(self, k, unicode=True): |
| 107 | """ Returns the data stored with the given id. |
| 108 | With unicode=True, returns a Unicode string. |
| 109 | """ |
| 110 | if k in self: |
| 111 | f = open(self._hash(k), "rb"); v=f.read().lstrip(codecs.BOM_UTF8) |
| 112 | f.close() |
| 113 | if unicode is True: |
| 114 | return decode_utf8(v) |
| 115 | else: |
| 116 | return v |
| 117 | raise KeyError, k |
| 118 | |
| 119 | def age(self, k): |
| 120 | """ Returns the age of the cached item, in days. |
no test coverage detected