hashed get
(self, hashroot, key, default=_sentinel, fast_only=True)
| 129 | self[hfile] = d |
| 130 | |
| 131 | def hget(self, hashroot, key, default=_sentinel, fast_only=True): |
| 132 | """hashed get""" |
| 133 | hroot = self.root / hashroot |
| 134 | hfile = hroot / gethashfile(key) |
| 135 | |
| 136 | d = self.get(hfile, _sentinel) |
| 137 | # print "got dict",d,"from",hfile |
| 138 | if d is _sentinel: |
| 139 | if fast_only: |
| 140 | if default is _sentinel: |
| 141 | raise KeyError(key) |
| 142 | |
| 143 | return default |
| 144 | |
| 145 | # slow mode ok, works even after hcompress() |
| 146 | d = self.hdict(hashroot) |
| 147 | |
| 148 | return d.get(key, default) |
| 149 | |
| 150 | def hdict(self, hashroot): |
| 151 | """Get all data contained in hashed category 'hashroot' as dict""" |
nothing calls this directly
no test coverage detected