Fixed an issue sending input to the mercurial and subversion processes.

Sat, 26 Aug 2017 16:49:16 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 26 Aug 2017 16:49:16 +0200
changeset 5848
56388f41b1e6
parent 5847
fd1262c3fa79
child 5849
512001065055

Fixed an issue sending input to the mercurial and subversion processes.

APIs/Python3/eric6.api file | annotate | diff | comparison | revisions
Debugger/DebugServer.py file | annotate | diff | comparison | revisions
Debugger/DebuggerInterfacePython2.py file | annotate | diff | comparison | revisions
Debugger/DebuggerInterfacePython3.py file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric6.Globals.__init__.html file | annotate | diff | comparison | revisions
Globals/__init__.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/GpgExtension/HgGpgSignaturesDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgBookmarksInOutDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgBookmarksListDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgConflictsListDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgTagBranchListDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveBrowserDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnBlameDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnChangeListsDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnRepoBrowserDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnStatusDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnTagBranchListDialog.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric6.api	Fri Aug 25 16:14:48 2017 +0200
+++ b/APIs/Python3/eric6.api	Sat Aug 26 16:49:16 2017 +0200
@@ -1703,6 +1703,7 @@
 eric6.Globals.settingsNameOrganization?7
 eric6.Globals.settingsNameRecent?7
 eric6.Globals.strGroup?4(txt, sep, groupLen=4)
+eric6.Globals.strToQByteArray?4(txt)
 eric6.Globals.toBool?4(value)
 eric6.Globals.toByteArray?4(value)
 eric6.Globals.toDict?4(value)
--- a/Debugger/DebugServer.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Debugger/DebugServer.py	Sat Aug 26 16:49:16 2017 +0200
@@ -30,6 +30,8 @@
 import Utilities
 
 
+# TODO: change this to a list of debugger interfaces and unite the two Python
+#       variants because they are nearly identical
 DebuggerInterfaces = {
     "Python2": "DebuggerInterfacePython2",
     "Python3": "DebuggerInterfacePython3",
@@ -292,6 +294,8 @@
         """
         Public slot to handle the preferencesChanged signal.
         """
+        # TODO: just build a set of registry data functions and call
+        #       registerDebuggerInterface with each of them
         registeredInterfaces = {}
         for language in self.__debuggerInterfaceRegistry:
             registeredInterfaces[language] = \
@@ -315,6 +319,8 @@
             to create the debugger interface (see __createDebuggerInterface())
         @type function
         """
+        # TODO: remove the 'name' parameter and move the check below against
+        #       clientLanguage
         if name in self.__debuggerInterfaceRegistry:
             E5MessageBox.warning(
                 None,
@@ -323,6 +329,7 @@
                         """ been registered. Ignoring this request.</p>"""))
             return
         
+        # TODO: change getRegistryData to return a list of registry entries
         clientLanguage, clientCapabilities, clientExtensions, \
             interfaceCreator = getRegistryData()
         if clientLanguage:
@@ -337,6 +344,7 @@
         @param name name of the debugger interface
         @type str
         """
+        # TODO: change name to a list of names
         if name in self.__debuggerInterfaceRegistry:
             del self.__debuggerInterfaceRegistry[name]
         
@@ -359,6 +367,7 @@
         """
         Private method to register the available internal debugger interfaces.
         """
+        # TODO: apply DebuggerInterfaces being a list
         for name, interface in DebuggerInterfaces.items():
             modName = "Debugger.{0}".format(interface)
             mod = __import__(modName)
@@ -366,6 +375,7 @@
             for comp in components[1:]:
                 mod = getattr(mod, comp)
             
+            # TODO: remove name parameter
             self.registerDebuggerInterface(name, mod.getRegistryData)
         
     def getSupportedLanguages(self, shellOnly=False):
--- a/Debugger/DebuggerInterfacePython2.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Debugger/DebuggerInterfacePython2.py	Sat Aug 26 16:49:16 2017 +0200
@@ -30,6 +30,7 @@
 ClientDefaultCapabilities = DebugClientCapabilities.HasAll
 
 
+# TODO: integrate it with DebuggerInterfacePython3 as DebuggerInterfacePython
 class DebuggerInterfacePython2(QObject):
     """
     Class implementing the Python 2 debugger interface for the debug server.
--- a/Debugger/DebuggerInterfacePython3.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Debugger/DebuggerInterfacePython3.py	Sat Aug 26 16:49:16 2017 +0200
@@ -30,6 +30,9 @@
 ClientDefaultCapabilities = DebugClientCapabilities.HasAll
 
 
+# TODO: integrate DebuggerInterfacePython2 here and rename as DebuggerInterfacePython
+# TODO: introduce a clientType parameter to the constructor being 'Python2' or 'Python3'
+# TODO: determine Preferences parameters based on this clientType
 class DebuggerInterfacePython3(QObject):
     """
     Class implementing the Python 3 debugger interface for the debug server.
@@ -1065,6 +1068,7 @@
             self.queue.append(cmd)
     
 
+# TODO: duplicate to create the interface object for Python2
 def createDebuggerInterfacePython3(debugServer, passive):
     """
     Module function to create a debugger interface instance.
@@ -1080,6 +1084,7 @@
     return DebuggerInterfacePython3(debugServer, passive)
 
 
+# TODO: change this to return a list of registry data tuples (one for Python2 and one for Python3)
 def getRegistryData():
     """
     Module function to get characterizing data for the debugger interface.
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Fri Aug 25 16:14:48 2017 +0200
+++ b/Documentation/Help/source.qhp	Sat Aug 26 16:49:16 2017 +0200
@@ -17395,6 +17395,7 @@
       <keyword name="startswithPath" id="startswithPath" ref="eric6.Utilities.__init__.html#startswithPath" />
       <keyword name="stdin_get_value" id="stdin_get_value" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.pycodestyle.html#stdin_get_value" />
       <keyword name="strGroup" id="strGroup" ref="eric6.Globals.__init__.html#strGroup" />
+      <keyword name="strToQByteArray" id="strToQByteArray" ref="eric6.Globals.__init__.html#strToQByteArray" />
       <keyword name="strip (Module)" id="strip (Module)" ref="eric6.Plugins.VcsPlugins.vcsMercurial.StripExtension.strip.html" />
       <keyword name="strip_PKCS7_padding" id="strip_PKCS7_padding" ref="eric6.Utilities.crypto.py3AES.html#strip_PKCS7_padding" />
       <keyword name="subversion (Module)" id="subversion (Module)" ref="eric6.Plugins.VcsPlugins.vcsPySvn.subversion.html" />
--- a/Documentation/Source/eric6.Globals.__init__.html	Fri Aug 25 16:14:48 2017 +0200
+++ b/Documentation/Source/eric6.Globals.__init__.html	Sat Aug 26 16:49:16 2017 +0200
@@ -73,6 +73,9 @@
 <td><a href="#strGroup">strGroup</a></td>
 <td>Module function to group a string into sub-strings separated by a separator.</td>
 </tr><tr>
+<td><a href="#strToQByteArray">strToQByteArray</a></td>
+<td>Module function to convert a Python string into a QByteArray.</td>
+</tr><tr>
 <td><a href="#toBool">toBool</a></td>
 <td>Module function to convert a value to bool.</td>
 </tr><tr>
@@ -299,6 +302,19 @@
 </dl>
 <div align="right"><a href="#top">Up</a></div>
 <hr /><hr />
+<a NAME="strToQByteArray" ID="strToQByteArray"></a>
+<h2>strToQByteArray</h2>
+<b>strToQByteArray</b>(<i>txt</i>)
+<p>
+    Module function to convert a Python string into a QByteArray.
+</p><dl>
+<dt><i>txt</i> (str, bytes, bytearray, unicode)</dt>
+<dd>
+Python string to be converted
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr /><hr />
 <a NAME="toBool" ID="toBool"></a>
 <h2>toBool</h2>
 <b>toBool</b>(<i>value</i>)
--- a/Globals/__init__.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Globals/__init__.py	Sat Aug 26 16:49:16 2017 +0200
@@ -263,7 +263,7 @@
     @param args tuple of arguments from QCoreApplication.translate (tuple)
     @return translated string (string)
     """
-    if QT_VERSION_STR.startswith('4'):
+    if QT_VERSION_STR.startswith('4.'):
         args = list(args)
         args.insert(3, QCoreApplication.CodecForTr)
     return QCoreApplication.translate(*args)
@@ -314,7 +314,7 @@
 
 
 ###############################################################################
-## functions for extended string handling
+## functions for version handling
 ###############################################################################
 
 
@@ -384,6 +384,23 @@
     return sep.join(groups)
 
 
+def strToQByteArray(txt):
+    """
+    Module function to convert a Python string into a QByteArray.
+    
+    @param txt Python string to be converted
+    @type str, bytes, bytearray, unicode
+    """
+    if sys.version_info[0] == 2:
+        if isinstance(txt, unicode):    # __IGNORE_WARNING__
+            txt = txt.encode("utf-8")
+    else:
+        if isinstance(txt, str):
+            txt = txt.encode("utf-8")
+    
+    return QByteArray(txt)
+
+
 ###############################################################################
 ## functions for converting QSetting return types to valid types
 ###############################################################################
--- a/Plugins/VcsPlugins/vcsMercurial/GpgExtension/HgGpgSignaturesDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/GpgExtension/HgGpgSignaturesDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -24,6 +24,8 @@
 
 from .Ui_HgGpgSignaturesDialog import Ui_HgGpgSignaturesDialog
 
+from Globals import strToQByteArray
+
 
 class HgGpgSignaturesDialog(QDialog, Ui_HgGpgSignaturesDialog):
     """
@@ -362,7 +364,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgAnnotateDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -25,6 +25,7 @@
 from .Ui_HgAnnotateDialog import Ui_HgAnnotateDialog
 
 import Preferences
+from Globals import strToQByteArray
 
 
 class HgAnnotateDialog(QDialog, Ui_HgAnnotateDialog):
@@ -295,7 +296,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsMercurial/HgBookmarksInOutDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgBookmarksInOutDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -23,6 +23,8 @@
 
 from .Ui_HgBookmarksInOutDialog import Ui_HgBookmarksInOutDialog
 
+from Globals import strToQByteArray
+
 
 class HgBookmarksInOutDialog(QDialog, Ui_HgBookmarksInOutDialog):
     """
@@ -302,7 +304,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsMercurial/HgBookmarksListDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgBookmarksListDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -26,6 +26,7 @@
 from .Ui_HgBookmarksListDialog import Ui_HgBookmarksListDialog
 
 import UI.PixmapCache
+from Globals import strToQByteArray
 
 
 class HgBookmarksListDialog(QDialog, Ui_HgBookmarksListDialog):
@@ -346,7 +347,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsMercurial/HgConflictsListDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgConflictsListDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -22,6 +22,7 @@
 from .Ui_HgConflictsListDialog import Ui_HgConflictsListDialog
 
 import Utilities.MimeTypes
+from Globals import strToQByteArray
 
 
 class HgConflictsListDialog(QWidget, Ui_HgConflictsListDialog):
@@ -336,7 +337,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsMercurial/HgDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -25,6 +25,7 @@
 
 import Preferences
 import Utilities
+from Globals import strToQByteArray
 
 
 class HgDialog(QDialog, Ui_HgDialog):
@@ -52,7 +53,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 = ''
         if useClient:
@@ -71,16 +72,16 @@
         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.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)
@@ -148,21 +149,21 @@
             self.resultbox.append('')
         
         if self.__hgClient is None:
-            self.proc = QProcess()
+            self.process = QProcess()
             if environment:
                 env = QProcessEnvironment.systemEnvironment()
                 for key, value in environment.items():
                     env.insert(key, value)
-                self.proc.setProcessEnvironment(env)
+                self.process.setProcessEnvironment(env)
             
-            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('hg', args)
-            procStarted = self.proc.waitForStarted(5000)
+                self.process.setWorkingDirectory(workingDir)
+            self.process.start('hg', args)
+            procStarted = self.process.waitForStarted(5000)
             if not procStarted:
                 self.buttonBox.setFocus()
                 self.inputGroup.setEnabled(False)
@@ -219,8 +220,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(),
                     self.vcs.getEncoding(),
                     'replace')
             self.__showOutput(s)
@@ -250,8 +251,8 @@
         It reads the error output of the process and inserts it into the
         error pane.
         """
-        if self.proc is not None:
-            s = str(self.proc.readAllStandardError(),
+        if self.process is not None:
+            s = str(self.process.readAllStandardError(),
                     self.vcs.getEncoding(),
                     'replace')
             self.__showError(s)
@@ -294,7 +295,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.proc.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -35,7 +35,7 @@
 import UI.PixmapCache
 import Preferences
 import Utilities
-from Globals import qVersionTuple
+from Globals import qVersionTuple, strToQByteArray
 
 COLORNAMES = ["blue", "darkgreen", "red", "green", "darkblue", "purple",
               "cyan", "olive", "magenta", "darkred", "darkmagenta",
@@ -1984,7 +1984,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgStatusDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -31,7 +31,7 @@
 
 import Preferences
 import UI.PixmapCache
-from Globals import qVersionTuple
+from Globals import qVersionTuple, strToQByteArray
 
 
 class HgStatusDialog(QWidget, Ui_HgStatusDialog):
@@ -533,7 +533,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsMercurial/HgTagBranchListDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgTagBranchListDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -26,6 +26,7 @@
 from .Ui_HgTagBranchListDialog import Ui_HgTagBranchListDialog
 
 import UI.PixmapCache
+from Globals import strToQByteArray
 
 
 class HgTagBranchListDialog(QDialog, Ui_HgTagBranchListDialog):
@@ -348,7 +349,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -23,6 +23,8 @@
 
 from .Ui_HgQueuesListDialog import Ui_HgQueuesListDialog
 
+from Globals import strToQByteArray
+
 
 class HgQueuesListDialog(QDialog, Ui_HgQueuesListDialog):
     """
@@ -418,7 +420,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveBrowserDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveBrowserDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -24,6 +24,8 @@
 
 from .Ui_HgShelveBrowserDialog import Ui_HgShelveBrowserDialog
 
+from Globals import strToQByteArray
+
 
 class HgShelveBrowserDialog(QWidget, Ui_HgShelveBrowserDialog):
     """
@@ -436,7 +438,7 @@
             self.errors.ensureCursorVisible()
         self.errorGroup.show()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsSubversion/SvnBlameDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnBlameDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -24,6 +24,7 @@
 from .Ui_SvnBlameDialog import Ui_SvnBlameDialog
 
 import Preferences
+from Globals import strToQByteArray
 
 
 class SvnBlameDialog(QDialog, Ui_SvnBlameDialog):
@@ -234,7 +235,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsSubversion/SvnChangeListsDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnChangeListsDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -24,6 +24,7 @@
 from .Ui_SvnChangeListsDialog import Ui_SvnChangeListsDialog
 
 import Preferences
+from Globals import strToQByteArray
 
 
 class SvnChangeListsDialog(QDialog, Ui_SvnChangeListsDialog):
@@ -249,7 +250,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- 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()
--- a/Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnDiffDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -28,6 +28,7 @@
 
 import Utilities
 import Preferences
+from Globals import strToQByteArray
 
 
 class SvnDiffDialog(QWidget, Ui_SvnDiffDialog):
@@ -446,7 +447,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -27,6 +27,7 @@
 
 import Preferences
 import UI.PixmapCache
+from Globals import strToQByteArray
 
 
 class SvnLogBrowserDialog(QWidget, Ui_SvnLogBrowserDialog):
@@ -745,7 +746,7 @@
             self.errors.ensureCursorVisible()
         self.errorGroup.show()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsSubversion/SvnRepoBrowserDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnRepoBrowserDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -27,6 +27,7 @@
 import UI.PixmapCache
 
 import Preferences
+from Globals import strToQByteArray
 
 
 class SvnRepoBrowserDialog(QDialog, Ui_SvnRepoBrowserDialog):
@@ -468,7 +469,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsSubversion/SvnStatusDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnStatusDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -26,6 +26,7 @@
 from .Ui_SvnStatusDialog import Ui_SvnStatusDialog
 
 import Preferences
+from Globals import strToQByteArray
 
 
 class SvnStatusDialog(QWidget, Ui_SvnStatusDialog):
@@ -558,7 +559,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()
--- a/Plugins/VcsPlugins/vcsSubversion/SvnTagBranchListDialog.py	Fri Aug 25 16:14:48 2017 +0200
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnTagBranchListDialog.py	Sat Aug 26 16:49:16 2017 +0200
@@ -24,6 +24,7 @@
 from .Ui_SvnTagBranchListDialog import Ui_SvnTagBranchListDialog
 
 import Preferences
+from Globals import strToQByteArray
 
 
 class SvnTagBranchListDialog(QDialog, Ui_SvnTagBranchListDialog):
@@ -320,7 +321,7 @@
             self.errors.insertPlainText(inputTxt)
             self.errors.ensureCursorVisible()
         
-        self.process.write(inputTxt)
+        self.process.write(strToQByteArray(inputTxt))
         
         self.passwordCheckBox.setChecked(False)
         self.input.clear()

eric ide

mercurial