Restores history from disk.
354916
def restore
      return unless File.exist?(Setting[:histfile])

      File.readlines(Setting[:histfile]).reverse_each { |l| push(l.chomp) }
    end
129428
public function reset()
    {
        $this->pos(0);
        $this->matchHistory = array(null, null);
        $this->ss = new StringSearch($this->src);
    }
469014
def _complete_history(self, cmd, args, text):
        """"""
        if args:
            return
        return [ x for x in { 'clear', 'clearall' } \
                if x.startswith(text) ]
471808
public function restore() {
        // if database, import database
        if ($this->_hasDatabaseDump()) {
            $this->restoreDatabase();
        } else {
            // Execute a spawn call in batch mode, to make sure all new columns are there
            $spawnCmd = new Garp_Cli_Command_Spawn();
            $spawnCmd->main(array('b' => true, 'only' => 'db'));
        }

        // set permissions on folders
        $this->setWritePermissions();

        // create snippets
        $this->createSnippets();

        // disable under construction
        Garp_Application::setUnderConstruction(false);
    }
800180
def _put_to_history(self, command_script):
        """"""
        history_file_name = self._get_history_file_name()
        if os.path.isfile(history_file_name):
            with open(history_file_name, 'a') as history:
                entry = self._get_history_line(command_script)
                if six.PY2:
                    history.write(entry.encode('utf-8'))
                else:
                    history.write(entry)
616529
def _restoreResults(newdir,origdir):
    
    for fname in glob.glob(os.path.join(newdir,'*')):
        shutil.move(fname,os.path.join(origdir,os.path.basename(fname)))
1284198
private function restore()
    {
        $this->deleteDirectory('app');
        $this->deleteDirectory('bootstrap');
        $this->deleteDirectory('routes');

        $this->info('Copying back App');
        File::copyDirectory($this->backupDirectory . '/app', 'app');
        $this->info('Copying back bootstrap');
        File::copyDirectory($this->backupDirectory . '/bootstrap', 'bootstrap');
        $this->info('Copying back routes');
        File::copyDirectory($this->backupDirectory . '/routes', 'routes');

        File::copy($this->backupDirectory . '/composer.json', 'composer.json');
        File::copy($this->backupDirectory . '/config/auth.php', 'config/auth.php');
        File::copy($this->backupDirectory . '/config/database.php', 'config/database.php');

        $this->info('Backup successful');
    }
12226
def update_history(self, directory):
        """"""
        try:
            directory = osp.abspath(to_text_string(directory))
            if directory in self.history:
                self.histindex = self.history.index(directory)
        except Exception:
            user_directory = get_home_dir()
            self.chdir(directory=user_directory, browsing_history=True)
1280942
protected function restore() {
        if (!$this->id) {
            return;
        }
        // Update all fields in the current object.
        $newrecord = self::get($this->id, MUST_EXIST, true);
        foreach (self::$coursecatfields as $key => $unused) {
            $this->$key = $newrecord->$key;
        }
    }
117020
public function restore()
    {
        $this->offsetRef = $this->offset;
        $this->lineRef = $this->line;
        $this->rowRef = $this->row;
    }
363190
protected function cleanHistory()
    {
        $createdAt = new \DateTime();
        $logs = $this->instance->getLogs();
        foreach($logs as $log) {
            if(($createdAt->getTimestamp() - $log->getCreatedAt()->getTimestamp()) > $this->expiredTimestamp) {
                $this->instance->removeLog($log);
            }
        }
    }
406741
def restore(self):
        
        setattr(self, self.get_deleted_at_column(), None)

        self.set_exists(True)

        result = self.save()

        return result
1211794
def OnBackView(self, event):
        """"""
        self.historyIndex -= 1
        try:
            self.RestoreHistory(self.history[self.historyIndex])
        except IndexError, err:
            self.SetStatusText(_('No further history available'))
185084
public function clearHistory()
    {
        $this->historyLines = array();
        $this->historyPosition = null;

        if ($this->historyUnsaved !== null) {
            $this->setInput($this->historyUnsaved);
            $this->historyUnsaved = null;
        }

        return $this;
    }
509660
public function restore()
    {
        if ($this->intStoredErrorLevel !== null) {
            if ($this->intStoredErrorLevel != -1) {
                error_reporting($this->intStoredErrorLevel);
            }
            restore_error_handler();
            $this->intStoredErrorLevel = null;
        }
    }
1049594
def restore_checkpoint(filename):
        """"""
        with gzip.open(filename) as f:
            generation, config, population, species_set, rndstate = pickle.load(f)
            random.setstate(rndstate)
            return Population(config, (population, species_set, generation))
168430
def restore(self):
        
        # NOTE: dup2 makes `self._from_fd` inheritable unconditionally
        self.redir_file.flush()
        os.dup2(self.orig_file.fileno(), self._from_fd)