parameters: (self, run_number, archive_list, prepare=None)
docstring: Performs an individual run of the default SCons invocations.
docstring_summary: Performs an individual run of the default SCons invocations.
docstring_tokens: Performs an individual run of the default SCons invocations .
function: def individual_run(self, run_number, archive_list, prepare=None):
          """
          Performs an individual run of the default SCons invocations.
          """
  
          commands = []
          removals = []
  
          if prepare:
              prepare(commands, removals)
  
          save_scons              = self.scons
          save_scons_wrapper      = self.scons_wrapper
          save_scons_lib_dir      = self.scons_lib_dir
  
          if self.outdir is None:
              self.outdir = self.orig_cwd
          elif not os.path.isabs(self.outdir):
              self.outdir = os.path.join(self.orig_cwd, self.outdir)
  
          if self.scons is None:
              self.scons = self.scons_path(self.orig_cwd)
  
          if self.scons_lib_dir is None:
              self.scons_lib_dir = self.scons_lib_dir_path(self.orig_cwd)
  
          if self.scons_wrapper is None:
              self.scons_wrapper = self.scons
  
          if not run_number:
              run_number = self.find_next_run_number(self.outdir, self.prefix)
  
          self.run_number = str(run_number)
  
          self.prefix_run = self.prefix + '-%03d' % run_number
  
          if self.targets0 is None:
              self.targets0 = self.startup_targets
          if self.targets1 is None:
              self.targets1 = self.targets
          if self.targets2 is None:
              self.targets2 = self.targets
  
          self.tmpdir = make_temp_file(prefix = self.name + '-')
  
          commands.extend([
              'mkdir %(tmpdir)s',
  
              (os.chdir, 'cd %%s', self.tmpdir),
          ])
  
          for archive in archive_list:
              if not os.path.isabs(archive):
                  archive = os.path.join(self.orig_cwd, archive)
              if os.path.isdir(archive):
                  dest = os.path.split(archive)[1]
                  commands.append((shutil.copytree, 'cp -r %%s %%s', archive, dest))
              else:
                  suffix = self.archive_splitext(archive)[1]
                  unpack_command = self.unpack_map.get(suffix)
                  if not unpack_command:
                      dest = os.path.split(archive)[1]
                      commands.append((shutil.copyfile, 'cp %%s %%s', archive, dest))
                  else:
                      commands.append(unpack_command + (archive,))
  
          commands.extend([
              (os.chdir, 'cd %%s', self.subdir),
          ])
  
          commands.extend(self.initial_commands)
  
          commands.extend([
              (lambda: read_tree('.'),
              'find * -type f | xargs cat > /dev/null'),
  
              (self.set_env, 'export %%s=%%s',
               'SCONS_LIB_DIR', self.scons_lib_dir),
  
              '%(python)s %(scons_wrapper)s --version',
          ])
  
          index = 0
          for run_command in self.run_commands:
              setattr(self, 'prof%d' % index, self.profile_name(index))
              c = (
                  self.log_execute,
                  self.log_display,
                  run_command,
                  self.logfile_name(index),
              )
              commands.append(c)
              index = index + 1
  
          commands.extend([
              (os.chdir, 'cd %%s', self.orig_cwd),
          ])
  
          if not os.environ.get('PRESERVE'):
              commands.extend(removals)
  
              commands.append((shutil.rmtree, 'rm -rf %%s', self.tmpdir))
  
          self.run_command_list(commands, self.__dict__)
  
          self.scons              = save_scons
          self.scons_lib_dir      = save_scons_lib_dir
          self.scons_wrapper      = save_scons_wrapper
function_tokens: def individual_run ( self , run_number , archive_list , prepare = None ) : commands = [ ] removals = [ ] if prepare : prepare ( commands , removals ) save_scons = self . scons save_scons_wrapper = self . scons_wrapper save_scons_lib_dir = self . scons_lib_dir if self . outdir is None : self . outdir = self . orig_cwd elif not os . path . isabs ( self . outdir ) : self . outdir = os . path . join ( self . orig_cwd , self . outdir ) if self . scons is None : self . scons = self . scons_path ( self . orig_cwd ) if self . scons_lib_dir is None : self . scons_lib_dir = self . scons_lib_dir_path ( self . orig_cwd ) if self . scons_wrapper is None : self . scons_wrapper = self . scons if not run_number : run_number = self . find_next_run_number ( self . outdir , self . prefix ) self . run_number = str ( run_number ) self . prefix_run = self . prefix + '-%03d' % run_number if self . targets0 is None : self . targets0 = self . startup_targets if self . targets1 is None : self . targets1 = self . targets if self . targets2 is None : self . targets2 = self . targets self . tmpdir = make_temp_file ( prefix = self . name + '-' ) commands . extend ( [ 'mkdir %(tmpdir)s' , ( os . chdir , 'cd %%s' , self . tmpdir ) , ] ) for archive in archive_list : if not os . path . isabs ( archive ) : archive = os . path . join ( self . orig_cwd , archive ) if os . path . isdir ( archive ) : dest = os . path . split ( archive ) [ 1 ] commands . append ( ( shutil . copytree , 'cp -r %%s %%s' , archive , dest ) ) else : suffix = self . archive_splitext ( archive ) [ 1 ] unpack_command = self . unpack_map . get ( suffix ) if not unpack_command : dest = os . path . split ( archive ) [ 1 ] commands . append ( ( shutil . copyfile , 'cp %%s %%s' , archive , dest ) ) else : commands . append ( unpack_command + ( archive , ) ) commands . extend ( [ ( os . chdir , 'cd %%s' , self . subdir ) , ] ) commands . extend ( self . initial_commands ) commands . extend ( [ ( lambda : read_tree ( '.' ) , 'find * -type f | xargs cat > /dev/null' ) , ( self . set_env , 'export %%s=%%s' , 'SCONS_LIB_DIR' , self . scons_lib_dir ) , '%(python)s %(scons_wrapper)s --version' , ] ) index = 0 for run_command in self . run_commands : setattr ( self , 'prof%d' % index , self . profile_name ( index ) ) c = ( self . log_execute , self . log_display , run_command , self . logfile_name ( index ) , ) commands . append ( c ) index = index + 1 commands . extend ( [ ( os . chdir , 'cd %%s' , self . orig_cwd ) , ] ) if not os . environ . get ( 'PRESERVE' ) : commands . extend ( removals ) commands . append ( ( shutil . rmtree , 'rm -rf %%s' , self . tmpdir ) ) self . run_command_list ( commands , self . __dict__ ) self . scons = save_scons self . scons_lib_dir = save_scons_lib_dir self . scons_wrapper = save_scons_wrapper