src/eric7/MicroPython/MicroPythonWebreplUrlAddEditDialog.py

branch
mpy_network
changeset 10010
8a68a7a7ab88
parent 10009
61e5fe703818
child 10019
e56089d00750
diff -r 61e5fe703818 -r 8a68a7a7ab88 src/eric7/MicroPython/MicroPythonWebreplUrlAddEditDialog.py
--- a/src/eric7/MicroPython/MicroPythonWebreplUrlAddEditDialog.py	Tue May 02 18:01:34 2023 +0200
+++ b/src/eric7/MicroPython/MicroPythonWebreplUrlAddEditDialog.py	Wed May 03 10:12:03 2023 +0200
@@ -53,6 +53,7 @@
             self.__populateFields(connectionParams)
         else:
             self.__editName = ""
+            self.__updateOkButton()
 
         msh = self.minimumSizeHint()
         self.resize(max(self.width(), msh.width()), msh.height())
@@ -68,14 +69,8 @@
         self.descriptionEdit.setText(params[1])
 
         url = params[2].replace("ws://", "")
-        if "@" in url:
-            password, hostPort = url.split("@", 1)
-        else:
-            password, hostPort = "", url
-        if ":" in hostPort:
-            host, port = hostPort.split(":", 1)
-        else:
-            host, port = hostPort, ""
+        password, hostPort = url.split("@", 1) if "@" in url else ("", url)
+        host, port = hostPort.split(":", 1) if ":" in hostPort else (hostPort, "")
         self.hostEdit.setText(host)
         self.portEdit.setText(port)
         self.passwordEdit.setText(password)
@@ -115,9 +110,9 @@
         """
         Public method to retrieve the entered WebREPL connection data.
 
-        @return tuple containing the name, description and URL for the WebREPL
-            connection
-        @rtype tuple of (str, str, str)
+        @return tuple containing the name, description, URL and device type for
+            the WebREPL connection
+        @rtype tuple of (str, str, str, str)
         """
         password = self.passwordEdit.text()
         host = self.hostEdit.text()

eric ide

mercurial