Reopen the active project when Spyder was closed last time, if any
19104
def reopen_last_project(self):
        
        current_project_path = self.get_option('current_project_path',
                                               default=None)

        # Needs a safer test of project existence!
        if current_project_path and \
          self.is_valid_project(current_project_path):
            self.open_project(path=current_project_path,
                              restart_consoles=False,
                              save_previous_files=False)
            self.load_config()
953361
def restart(self):
        
        self.master_clients = 0
        self.create_new_client_if_empty = False
        for i in range(len(self.clients)):
            client = self.clients[-1]
            try:
                client.shutdown()
            except Exception as e:
                QMessageBox.warning(self, _('Warning'),
                    _("It was not possible to restart the IPython console "
                      "when switching to this project. The error was<br><br>"
                      "<tt>{0}</tt>").format(e), QMessageBox.Ok)
            self.close_client(client=client, force=True)
        self.create_new_client(give_focus=False)
        self.create_new_client_if_empty = True
178378
def reopen(self):
        
        assignee = self.assignee.login if self.assignee else ''
        number = self.milestone.number if self.milestone else None
        labels = [str(l) for l in self.labels]
        return self.edit(self.title, self.body, assignee, 'open',
                         number, labels)
1119213
def open(self, fnames=None):
        """"""
        if fnames is None:
            fnames = self.get_selected_filenames()
        for fname in fnames:
            if osp.isfile(fname) and encoding.is_text_file(fname):
                self.parent_widget.sig_open_file.emit(fname)
            else:
                self.open_outside_spyder([fname])
186840
def reload(self):
        """"""
        pid = self._read_pidfile()
        if pid is None or pid != os.getpid():
            raise DaemonError(
                'Daemon.reload() should only be called by the daemon process '
                'itself')

        # Copy the current environment
        new_environ = os.environ.copy()
        new_environ['DAEMONOCLE_RELOAD'] = 'true'
        # Start a new python process with the same arguments as this one
        subprocess.call(
            [sys.executable] + sys.argv, cwd=self._orig_workdir,
            env=new_environ)
        # Exit this process
        self._shutdown('Shutting down for reload')
787365
async function action(projectDir, options) {
  await Detach.detachAsync(projectDir, options);
  // yesno lib doesn't properly shut down. without this the command won't exit
  process.stdin.pause();
}
81182
def open_last_closed(self):
        
        editorstack = self.get_current_editorstack()
        last_closed_files = editorstack.get_last_closed_files()
        if (len(last_closed_files) > 0):
            file_to_open = last_closed_files[0]
            last_closed_files.remove(file_to_open)
            editorstack.set_last_closed_files(last_closed_files)
            self.load(file_to_open)
359678
def project_closed(self, project):
        

        yield from super().project_closed(project)
        hdd_files_to_close = yield from self._find_inaccessible_hdd_files()
        for hdd_file in hdd_files_to_close:
            log.info("Closing VirtualBox VM disk file {}".format(os.path.basename(hdd_file)))
            try:
                yield from self.execute("closemedium", ["disk", hdd_file])
            except VirtualBoxError as e:
                log.warning("Could not close VirtualBox VM disk file {}: {}".format(os.path.basename(hdd_file), e))
                continue
635715
def reload(self):
        
        cluster_pb = self._instance._client.instance_admin_client.get_cluster(self.name)

        # NOTE: _update_from_pb does not check that the project and
        #       cluster ID on the response match the request.
        self._update_from_pb(cluster_pb)
463191
def postActivate_(self):
        
        self.analyzer = LicensePlateDetector(**self.analyzer_pars) # this is called after the fork (i.e. after the multiprocess has been spawned)
        self.report("analyzer object=", self.analyzer)
572144
def reset(self):
        
        self._cli.reset()
        self._cli.buffers[DEFAULT_BUFFER].reset()
        self._cli.renderer.request_absolute_cursor_position()
        self._cli._redraw()
1037096
def reopen_after_fork!
#       logger.debug { "#{self.class}##{__method__}" }
      @mutex = Monitor.new
      @setup_watcher_mutex = Monitor.new

      # XXX: need to test this w/ actor-style callbacks
      
      @state = :running
      @callbacks.values.flatten.each { |cb| cb.reopen_after_fork! if cb.respond_to?(:reopen_after_fork!) }
      @outstanding_watches.values.each { |set| set.clear }
      nil
    end
580836
def restore(self):
        

        yield from self._project.delete_on_computes()
        # We don't send close notif to clients because the close / open dance is purely internal
        yield from self._project.close(ignore_notification=True)
        self._project.controller.notification.emit("snapshot.restored", self.__json__())
        try:
            if os.path.exists(os.path.join(self._project.path, "project-files")):
                shutil.rmtree(os.path.join(self._project.path, "project-files"))
            with open(self._path, "rb") as f:
                project = yield from import_project(self._project.controller, self._project.id, f, location=self._project.path)
        except (OSError, PermissionError) as e:
            raise aiohttp.web.HTTPConflict(text=str(e))
        yield from project.open()
        return project
1212802
def reset_config_files():
    """"""
    print("*** Reset Spyder settings to defaults ***", file=STDERR)
    for fname in SAVED_CONFIG_FILES:
        cfg_fname = get_conf_path(fname)
        if osp.isfile(cfg_fname) or osp.islink(cfg_fname):
            os.remove(cfg_fname)
        elif osp.isdir(cfg_fname):
            shutil.rmtree(cfg_fname)
        else:
            continue
        print("removing:", cfg_fname, file=STDERR)
384953
def reopen_after_fork!
    logger.debug { "#{self.class}##{__method__} fork detected!" } if forked?

    @mutex = Monitor.new
    @dispatch_shutdown_cond = @mutex.new_cond
    @event_queue = QueueWithPipe.new

    @dispatcher = nil if @dispatcher and not @dispatcher.alive?

    update_pid!  # from Forked
  end
1272532
def do_close(self, args):
        """"""

        if not self.current:
            print('There are no resources in use. Use the command "open".')
            return

        try:
            self.current.close()
        except Exception as e:
            print(e)
        else:
            print('The resource has been closed.')
            self.current = None
            self.prompt = self.default_prompt
29460
def reinstall(self):
        
        with _LOCK:
            if not (self.thread.is_alive() and self.thread in _ORIGINAL__ACTIVE):
                self.thread = self.thread.clone(bind_delay=self.reinstall_delay)
                if self.should_restart:
                    self.thread.start()