Exemplo n.º 1
0
    def process_packet(self, feedline):
        feedline = str(feedline)
        self.status['parse_error'] = True
        packet = {}

        if not feedline.startswith("*"):
            if feedline.startswith("#"):
                self._finish_command_response()
            else:
                self._process_command_response(feedline)
            return

        parts = feedline[2:].rstrip().split(' ')
        for part in parts:
            pair = part.split('=')
            if len(pair) != 2:
                return
            packet[str(pair[0])] = str(pair[1])

        locker = QMutexLocker(self.lock)
        try:
            self.status.update({
                "rpm": int(packet['rpm']),
                "sync": True if packet['sync'] == "1" else False,
                "t0_count": int(packet['t0_count']),
                "map": float(packet['map']),
                "advance": float(packet['adv']),
                "dwell": int(packet['dwell_us'])
                })
        except:
            return
        finally:
            locker.unlock()
        self.status['parse_error'] = False
        self.feed_update.emit()
 def start(self, path):
     """
     Public slot to populate the data.
     
     @param path directory name to show change lists for (string)
     """
     self.changeListsDict = {}
     self.cancelled = False
     
     self.filesLabel.setText(self.trUtf8("Files (relative to %1):").arg(path))
     
     QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
     QApplication.processEvents()
     
     locker = QMutexLocker(self.vcs.vcsExecutionMutex)
     try:
         entries = self.client.get_changelist(path, depth=pysvn.depth.infinity)
         for entry in entries:
             file = entry[0]
             changelist = entry[1]
             if changelist not in self.changeListsDict:
                 self.changeListsDict[changelist] = []
             filename = file.replace(path + os.sep, "")
             if filename not in self.changeListsDict[changelist]:
                 self.changeListsDict[changelist].append(filename)
     except pysvn.ClientError as e:
         locker.unlock()
         self.__showError(e.args[0])
     self.__finish()