parameters: (self)
docstring: Load the data from a previous run, sets the attributes listed in :py:const:`waflib.Build.SAVED_ATTRS`
docstring_summary: Load the data from a previous run, sets the attributes listed in :py:const:`waflib.Build.SAVED_ATTRS`
docstring_tokens: Load the data from a previous run sets the attributes listed in : py : const : waflib . Build . SAVED_ATTRS
function: def restore(self):
  		"""
  		Load the data from a previous run, sets the attributes listed in :py:const:`waflib.Build.SAVED_ATTRS`
  		"""
  		try:
  			env = ConfigSet.ConfigSet(os.path.join(self.cache_dir, 'build.config.py'))
  		except (IOError, OSError):
  			pass
  		else:
  			if env['version'] < Context.HEXVERSION:
  				raise Errors.WafError('Version mismatch! reconfigure the project')
  			for t in env['tools']:
  				self.setup(**t)
  
  		dbfn = os.path.join(self.variant_dir, Context.DBFILE)
  		try:
  			data = Utils.readf(dbfn, 'rb')
  		except (IOError, EOFError):
  			# handle missing file/empty file
  			Logs.debug('build: Could not load the build cache %s (missing)' % dbfn)
  		else:
  			try:
  				waflib.Node.pickle_lock.acquire()
  				waflib.Node.Nod3 = self.node_class
  				try:
  					data = pickle.loads(data)
  				except Exception as e:
  					Logs.debug('build: Could not pickle the build cache %s: %r' % (dbfn, e))
  				else:
  					for x in SAVED_ATTRS:
  						if x in data:
  							setattr(self, x, data[x])
  						else:
  							Logs.debug("build: SAVED_ATTRS key %s missing from cache" % x)
  			finally:
  				waflib.Node.pickle_lock.release()
  
  		self.init_dirs()
function_tokens: def restore ( self ) : try : env = ConfigSet . ConfigSet ( os . path . join ( self . cache_dir , 'build.config.py' ) ) except ( IOError , OSError ) : pass else : if env [ 'version' ] < Context . HEXVERSION : raise Errors . WafError ( 'Version mismatch! reconfigure the project' ) for t in env [ 'tools' ] : self . setup ( * * t ) dbfn = os . path . join ( self . variant_dir , Context . DBFILE ) try : data = Utils . readf ( dbfn , 'rb' ) except ( IOError , EOFError ) : # handle missing file/empty file Logs . debug ( 'build: Could not load the build cache %s (missing)' % dbfn ) else : try : waflib . Node . pickle_lock . acquire ( ) waflib . Node . Nod3 = self . node_class try : data = pickle . loads ( data ) except Exception as e : Logs . debug ( 'build: Could not pickle the build cache %s: %r' % ( dbfn , e ) ) else : for x in SAVED_ATTRS : if x in data : setattr ( self , x , data [ x ] ) else : Logs . debug ( "build: SAVED_ATTRS key %s missing from cache" % x ) finally : waflib . Node . pickle_lock . release ( ) self . init_dirs ( )