Plugins/VcsPlugins/vcsSubversion/SvnDialog.py

changeset 5848
56388f41b1e6
parent 5624
cdd346d8858b
child 6048
82ad8ec9548c
diff -r fd1262c3fa79 -r 56388f41b1e6 Plugins/VcsPlugins/vcsSubversion/SvnDialog.py
--- a/Plugins/VcsPlugins/vcsSubversion/SvnDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -23,6 +23,7 @@
 from .Ui_SvnDialog import Ui_SvnDialog
 
 import Preferences
+from Globals import strToQByteArray
 
 
 class SvnDialog(QDialog, Ui_SvnDialog):
@@ -47,7 +48,7 @@
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
         self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
         
-        self.proc = None
+        self.process = None
         self.username = ''
         self.password = ''
         
@@ -58,11 +59,11 @@
         Private slot called when the process finished or the user pressed the
         button.
         """
-        if self.proc is not None and \
-           self.proc.state() != QProcess.NotRunning:
-            self.proc.terminate()
-            QTimer.singleShot(2000, self.proc.kill)
-            self.proc.waitForFinished(3000)
+        if self.process is not None and \
+           self.process.state() != QProcess.NotRunning:
+            self.process.terminate()
+            QTimer.singleShot(2000, self.process.kill)
+            self.process.waitForFinished(3000)
         
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
         self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
@@ -71,7 +72,7 @@
         self.inputGroup.setEnabled(False)
         self.inputGroup.hide()
         
-        self.proc = None
+        self.process = None
         
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)
         self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
@@ -120,11 +121,11 @@
         
         self.__hasAddOrDelete = False
         
-        self.proc = QProcess()
+        self.process = QProcess()
         if setLanguage:
             env = QProcessEnvironment.systemEnvironment()
             env.insert("LANG", "C")
-            self.proc.setProcessEnvironment(env)
+            self.process.setProcessEnvironment(env)
         nargs = []
         lastWasPwd = False
         for arg in args:
@@ -139,14 +140,14 @@
         self.resultbox.append(' '.join(nargs))
         self.resultbox.append('')
         
-        self.proc.finished.connect(self.__procFinished)
-        self.proc.readyReadStandardOutput.connect(self.__readStdout)
-        self.proc.readyReadStandardError.connect(self.__readStderr)
+        self.process.finished.connect(self.__procFinished)
+        self.process.readyReadStandardOutput.connect(self.__readStdout)
+        self.process.readyReadStandardError.connect(self.__readStderr)
         
         if workingDir:
-            self.proc.setWorkingDirectory(workingDir)
-        self.proc.start('svn', args)
-        procStarted = self.proc.waitForStarted(5000)
+            self.process.setWorkingDirectory(workingDir)
+        self.process.start('svn', args)
+        procStarted = self.process.waitForStarted(5000)
         if not procStarted:
             self.buttonBox.setFocus()
             self.inputGroup.setEnabled(False)
@@ -178,8 +179,8 @@
         It reads the output of the process, formats it and inserts it into
         the contents pane.
         """
-        if self.proc is not None:
-            s = str(self.proc.readAllStandardOutput(),
+        if self.process is not None:
+            s = str(self.process.readAllStandardOutput(),
                     Preferences.getSystem("IOEncoding"),
                     'replace')
             self.resultbox.insertPlainText(s)
@@ -201,9 +202,9 @@
         It reads the error output of the process and inserts it into the
         error pane.
         """
-        if self.proc is not None:
+        if self.process is not None:
             self.errorGroup.show()
-            s = str(self.proc.readAllStandardError(),
+            s = str(self.process.readAllStandardError(),
                     Preferences.getSystem("IOEncoding"),
                     'replace')
             self.errors.insertPlainText(s)
@@ -235,7 +236,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.proc.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()

eric ide

mercurial