Пример #1
0
    def save(self,
             name='',
             rewind_snapshot='',
             next_function=None,
             error_function=None):
        self.next_snapshot_name = name
        self._rw_snapshot = rewind_snapshot
        self.next_function = next_function
        self.error_function = error_function

        if not self.canSave():
            Terminal.message("can't snapshot")
            return

        err = self.writeExcludeFile()
        if err:
            self.errorQuit(err)
            return

        self._adder_aborted = False

        if not self._changes_counted:
            self.hasChanges()

        self._changes_counted = False

        if self._n_file_changed:
            all_args = self.getGitCommandList('add', '-A', '-v')
            self.adder_process.start(self.git_exec, all_args)
        else:
            self.save_step_1()
Пример #2
0
    def nsmClientGui_is_shown(self, path, args, types, src_addr):
        client = self.session.getClientByAddress(src_addr)
        if not client:
            return False

        Terminal.message("Client '%s' sends gui shown" % client.client_id)

        client.gui_visible = True

        self.sendGui("/ray/gui/client/gui_visible", client.client_id,
                     int(client.gui_visible))
Пример #3
0
    def nsmClientIs_clean(self, path, args, types, src_addr):
        client = self.session.getClientByAddress(src_addr)
        if not client:
            return False

        Terminal.message("%s sends clean" % client.client_id)

        client.dirty = 0

        self.sendGui("/ray/gui/client/dirty", client.client_id, client.dirty)
        return False
Пример #4
0
    def nsmClientIs_dirty(self, path, args, types, src_addr):
        client = self.session.getClientByAddress(src_addr)
        if not client:
            return False

        Terminal.message("%s sends dirty" % client.client_id)

        client.dirty = 1
        client.last_dirty = time.time()

        self.sendGui("/ray/gui/client/dirty", client.client_id, client.dirty)
Пример #5
0
    def adderStandardOutput(self):
        standard_output = self.adder_process.readAllStandardOutput().data()
        Terminal.snapshoterMessage(standard_output, ' add -A -v')

        if not self._n_file_changed:
            return

        self._n_file_treated += len(standard_output.decode().split('\n')) - 1

        self.session.sendGui('/ray/gui/server/progress',
                             self._n_file_treated / self._n_file_changed)
Пример #6
0
    def _adder_standard_output(self):
        standard_output = self._adder_process.readAllStandardOutput().data()
        Terminal.snapshoter_message(standard_output, ' add -A -v')

        if not self._n_file_changed:
            return

        self._n_file_treated += len(standard_output.splitlines()) - 1

        self.session.send_gui('/ray/gui/server/progress',
                              self._n_file_treated / self._n_file_changed)
Пример #7
0
    def announceGui(self, url, nsm_locked=False, is_net_free=True):
        gui_addr = liblo.Address(url)

        options = self.getOptions()

        self.send(gui_addr, "/ray/gui/server/announce", ray.VERSION,
                  self.server_status, options, self.session.root,
                  int(is_net_free))

        self.send(gui_addr, "/ray/gui/server/status", self.server_status)
        self.send(gui_addr, "/ray/gui/session/name", self.session.name,
                  self.session.path)
        self.send(gui_addr, '/ray/gui/session/notes', self.session.notes)

        for favorite in RS.favorites:
            self.send(gui_addr, "/ray/gui/favorites/added", favorite.name,
                      favorite.icon, int(favorite.factory))

        for client in self.session.clients:
            self.send(gui_addr, '/ray/gui/client/new', *client.spread())

            if client.protocol == ray.Protocol.RAY_HACK:
                self.send(gui_addr, '/ray/gui/client/ray_hack_update',
                          client.client_id, *client.ray_hack.spread())

            self.send(gui_addr, "/ray/gui/client/status", client.client_id,
                      client.status)

            if client.isCapableOf(':optional-gui:'):
                self.send(gui_addr, '/ray/gui/client/has_optional_gui',
                          client.client_id)

                self.send(gui_addr, '/ray/gui/client/gui_visible',
                          client.client_id, client.gui_visible)

        self.gui_list.append(gui_addr)

        multi_daemon_file = MultiDaemonFile.getInstance()
        if multi_daemon_file:
            multi_daemon_file.update()

        Terminal.message("GUI connected at %s" % gui_addr.url)
Пример #8
0
 def standardOutput(self):
     standard_output = self.git_process.readAllStandardOutput().data()
     Terminal.snapshoterMessage(standard_output, self.git_command)
Пример #9
0
 def standardError(self):
     standard_error = self.git_process.readAllStandardError().data()
     Terminal.snapshoterMessage(standard_error, self.git_command)
Пример #10
0
 def standardOutput(self):
     standard_output = self._process.readAllStandardOutput().data()
     Terminal.scripterMessage(standard_output, self.getCommandName())
Пример #11
0
 def standardError(self):
     standard_error = self._process.readAllStandardError().data()
     Terminal.scripterMessage(standard_error, self.getCommandName())
Пример #12
0
            sys.exit()
    server.start()

    if CommandLineArgs.hidden:
        server.setAsNotDefault()

    #announce server to GUI
    if CommandLineArgs.gui_url:
        server.announceGui(CommandLineArgs.gui_url.url)

    # announce to ray_control if launched from it.
    if CommandLineArgs.control_url:
        server.announceController(CommandLineArgs.control_url)

    #print server url
    Terminal.message('URL : %s' % ray.getNetUrl(server.port))
    Terminal.message('      %s' % server.url)
    Terminal.message('ROOT: %s' % CommandLineArgs.session_root)

    #create or update multi_daemon_file in /tmp
    multi_daemon_file = MultiDaemonFile(session, server)
    multi_daemon_file.update()

    #clean bookmarks created by crashed daemons
    session.bookmarker.clean(multi_daemon_file.getAllSessionPaths())

    #load session asked from command line
    if CommandLineArgs.session:
        session.serverOpenSessionAtStart(CommandLineArgs.session)

    #connect SIGINT and SIGTERM
Пример #13
0
 def _standard_output(self):
     standard_output = self._process.readAllStandardOutput().data()
     Terminal.scripter_message(standard_output, self._get_command_name())
Пример #14
0
 def _standard_error(self):
     standard_error = self._process.readAllStandardError().data()
     Terminal.scripter_message(standard_error, self._get_command_name())