コード例 #1
0
 def store(self):
     build_cache = self.bld_root.make_node(BUILD_CACHE)
     tmp_fid = open(build_cache.abspath() + ".tmp", "wb")
     try:
         dump(self.cache, tmp_fid)
     finally:
         tmp_fid.close()
     rename(build_cache.abspath() + ".tmp", build_cache.abspath())
コード例 #2
0
ファイル: context.py プロジェクト: abadger/Bento
 def store(self):
     build_cache = self.bld_root.make_node(BUILD_CACHE)
     tmp_fid = open(build_cache.abspath() + ".tmp", "wb")
     try:
         dump(self.cache, tmp_fid)
     finally:
         tmp_fid.close()
     rename(build_cache.abspath() + ".tmp", build_cache.abspath())
コード例 #3
0
 def save(self):
     # Use rename to avoid corrupting the cache if interrupted
     tmp_fid = open(CACHE_FILE + ".tmp", "w")
     try:
         dump(self.cache, tmp_fid)
     finally:
         tmp_fid.close()
     rename(CACHE_FILE + ".tmp", CACHE_FILE)
コード例 #4
0
ファイル: build_context.py プロジェクト: B-Rich/Bento
 def save(self):
     # Use rename to avoid corrupting the cache if interrupted
     tmp_fid = open(CACHE_FILE + ".tmp", "w")
     try:
         dump(self.cache, tmp_fid)
     finally:
         tmp_fid.close()
     rename(CACHE_FILE + ".tmp", CACHE_FILE)
コード例 #5
0
ファイル: context.py プロジェクト: dagss/yaku
 def store(self):
     # Use rename to avoid corrupting the cache if interrupted
     tmp_fid = open(BUILD_CACHE + ".tmp", "wb")
     try:
         dump(self.cache, tmp_fid)
     finally:
         tmp_fid.close()
     rename(BUILD_CACHE + ".tmp", BUILD_CACHE)
コード例 #6
0
ファイル: environment.py プロジェクト: B-Rich/Bento
 def store(self, filename):
     tmp = filename + ".tmp"
     ensure_dir(tmp)
     fid = open(tmp, "w")
     try:
         for k in sorted(self.keys()):
             fid.write("%s = %r\n" % (k, self[k]))
     finally:
         fid.close()
     rename(tmp, filename)
コード例 #7
0
 def store(self, filename):
     tmp = filename + ".tmp"
     ensure_dir(tmp)
     fid = open(tmp, "w")
     try:
         for k in sorted(self.keys()):
             fid.write("%s = %r\n" % (k, self[k]))
     finally:
         fid.close()
     rename(tmp, filename)