_cache_file = _os_path.expanduser(
_os_path.join('~', '.apachelog-resolver.cache'))
_cache_loaded = False
_cache_file = _os_path.expanduser(
_os_path.join('~', '.apachelog-resolver.cache'))
_cache_loaded = False
try:
with open(self._cache_file, 'rb') as f:
self.IP = _pickle.load(f)
try:
with open(self._cache_file, 'rb') as f:
self.IP = _pickle.load(f)
- with open(self._cache_file, 'wb') as f:
- _pickle.dump(self.IP, f)
+ if self._cache_dirty:
+ with open(self._cache_file, 'wb') as f:
+ _pickle.dump(self.IP, f)