Commits

Yuya Nishihara  committed c508d0d

cmdcore: add _-prefix to all private methods of CmdSession

  • Participants
  • Parent commits a8d0c27

Comments (0)

Files changed (1)

File tortoisehg/hgqt/cmdcore.py

     def run(self):
         '''Execute Mercurial command'''
         if not self.running():
-            self.runNext()
+            self._runNext()
 
     def cancel(self):
         '''Cancel running Mercurial command'''
 
     def running(self):
         # keep "running" until just before emitting commandFinished. if worker
-        # is QThread, isRunning() is cleared earlier than onCommandFinished,
+        # is QThread, isRunning() is cleared earlier than _onCommandFinished,
         # because inter-thread signal is queued.
         return bool(self._worker)
 
         else:
             return thread.CmdThread(cmdline, self)
 
-    def runNext(self):
+    def _runNext(self):
         if not self._queue:
             return False
 
         if not self._display:
             self._display = _prettifycmdline(cmdline)
         self._worker = self._createWorker(cmdline)
-        self._worker.started.connect(self.onCommandStarted)
-        self._worker.commandFinished.connect(self.onCommandFinished)
+        self._worker.started.connect(self._onCommandStarted)
+        self._worker.commandFinished.connect(self._onCommandFinished)
 
         self._worker.outputReceived.connect(self.outputReceived)
         self._worker.progressReceived.connect(self.progressReceived)
     ### Signal Handlers ###
 
     @pyqtSlot()
-    def onCommandStarted(self):
+    def _onCommandStarted(self):
         cmd = '%% hg %s\n' % self._display
         self.outputReceived.emit(cmd, 'control')
 
     @pyqtSlot(int)
-    def onCommandFinished(self, ret):
+    def _onCommandFinished(self, ret):
         if ret == -1:
             if self._abortbyuser:
                 msg = _('[command terminated by user %s]')
 
         self._display = None
         self._worker.setParent(None)  # assist gc
-        if ret == 0 and self.runNext():
+        if ret == 0 and self._runNext():
             return # run next command
         else:
             self._queue = []