parameters: (self)
docstring: Load data from a previous run, sets the attributes listed in :py:const:`waflib.Build.SAVED_ATTRS`
docstring_summary: Load data from a previous run, sets the attributes listed in :py:const:`waflib.Build.SAVED_ATTRS`
docstring_tokens: Load data from a previous run sets the attributes listed in : py : const : waflib . Build . SAVED_ATTRS
function: def restore(self):
  		"""
  		Load 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 EnvironmentError:
  			pass
  		else:
  			if env.version < Context.HEXVERSION:
  				raise Errors.WafError('Project was configured with a different version of Waf, please reconfigure it')
  
  			for t in env.tools:
  				self.setup(**t)
  
  		dbfn = os.path.join(self.variant_dir, Context.DBFILE)
  		try:
  			data = Utils.readf(dbfn, 'rb')
  		except (EnvironmentError, EOFError):
  			# handle missing file/empty file
  			Logs.debug('build: Could not load the build cache %s (missing)', dbfn)
  		else:
  			try:
  				Node.pickle_lock.acquire()
  				Node.Nod3 = self.node_class
  				try:
  					data = cPickle.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:
  						setattr(self, x, data.get(x, {}))
  			finally:
  				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 EnvironmentError : pass else : if env . version < Context . HEXVERSION : raise Errors . WafError ( 'Project was configured with a different version of Waf, please reconfigure it' ) for t in env . tools : self . setup ( * * t ) dbfn = os . path . join ( self . variant_dir , Context . DBFILE ) try : data = Utils . readf ( dbfn , 'rb' ) except ( EnvironmentError , EOFError ) : # handle missing file/empty file Logs . debug ( 'build: Could not load the build cache %s (missing)' , dbfn ) else : try : Node . pickle_lock . acquire ( ) Node . Nod3 = self . node_class try : data = cPickle . 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 : setattr ( self , x , data . get ( x , { } ) ) finally : Node . pickle_lock . release ( ) self . init_dirs ( )