src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostFingerprintDialog.py

branch
eric7
changeset 11071
913935b0e580
parent 10439
21c28b0f9e41
child 11090
f5f5f5803935
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostFingerprintDialog.py	Mon Dec 02 11:37:38 2024 +0100
+++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostFingerprintDialog.py	Mon Dec 02 15:48:03 2024 +0100
@@ -45,15 +45,10 @@
 
         self.hashComboBox.addItem("")
         self.hashComboBox.addItems(HgUserConfigHostFingerprintDialog.supportedHashes)
-        if self.__version < (3, 9, 0):
-            self.hashLabel.setEnabled(False)
-            self.hashComboBox.setEnabled(False)
-            hashType = "sha1"
+        if fingerprint and fingerprint.startswith("sha"):
+            hashType, fingerprint = fingerprint.split(":", 1)
         else:
-            if fingerprint and fingerprint.startswith("sha"):
-                hashType, fingerprint = fingerprint.split(":", 1)
-            else:
-                hashType = ""
+            hashType = ""
 
         index = self.hashComboBox.findText(hashType)
         self.hashComboBox.setCurrentIndex(index)
@@ -70,14 +65,14 @@
         Private method to update the status of the Ok button.
         """
         enabled = bool(self.hostEdit.text()) and bool(self.fingerprintEdit.text())
-        if self.__version >= (3, 9, 0):
-            hashType = self.hashComboBox.currentText()
-            enabled &= bool(hashType)
-            if hashType:
-                enabled &= (
-                    len(self.fingerprintEdit.text().replace(":", ""))
-                    == HgUserConfigHostFingerprintDialog.fingerprintLength[hashType]
-                )
+
+        hashType = self.hashComboBox.currentText()
+        enabled &= bool(hashType)
+        if hashType:
+            enabled &= (
+                len(self.fingerprintEdit.text().replace(":", ""))
+                == HgUserConfigHostFingerprintDialog.fingerprintLength[hashType]
+            )
 
         self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(enabled)
 
@@ -133,12 +128,8 @@
         @return tuple containig the host name and the fingerprint
         @rtype tuple of two str
         """
-        fingerprint = (
-            self.fingerprintEdit.text()
-            if self.__version < (3, 9, 0)
-            else "{0}:{1}".format(
-                self.hashComboBox.currentText(), self.fingerprintEdit.text().strip()
-            )
+        fingerprint = "{0}:{1}".format(
+            self.hashComboBox.currentText(), self.fingerprintEdit.text().strip()
         )
 
         return self.hostEdit.text().strip(), fingerprint

eric ide

mercurial