示例#1
0
文件: cache.py 项目: bluele/Lamia
 def _save(self):
     '''
     @summary: 
         現在のメモリキャッシュでキャッシュファイルを更新します
     '''
     try:
         for key, cache in self.cache.iteritems():
             dump(cache, build_path(self.cache_dir, key))
     except Exception:
         # pickle error
         raise
示例#2
0
文件: cache.py 项目: bluele/Lamia
 def _store_cache_file(self, key, val, expiration_date):
     '''
     @summary: 
         ファイル上のキャッシュにキーと値を格納します
     '''
     try:
         if isinstance(val, unicode):
             val = val.encode(self.default_encoding)
         dump(_CacheData(val=val, expiration_date=expiration_date),
              build_path(self.cache_dir, key))
     except Exception:
         raise