eric6/WebBrowser/UrlBar/UrlBar.py

changeset 7270
41d09cf20415
parent 7229
53054eb5b15a
child 7360
9190402e4505
--- a/eric6/WebBrowser/UrlBar/UrlBar.py	Wed Sep 25 18:52:40 2019 +0200
+++ b/eric6/WebBrowser/UrlBar/UrlBar.py	Wed Sep 25 19:00:09 2019 +0200
@@ -144,8 +144,7 @@
             for bookmark in bookmarks:
                 manager.setTimestamp(bookmark, BookmarkNode.TsVisited,
                                      QDateTime.currentDateTime())
-        elif self.__mw.speedDial()\
-                .pageForUrl(self.__browser.url()).url != "":
+        elif self.__mw.speedDial().pageForUrl(self.__browser.url()).url != "":
             self.__bookmarkButton.setIcon(self.__bmActiveIcon)
         else:
             self.__bookmarkButton.setIcon(self.__bmInactiveIcon)
@@ -187,8 +186,9 @@
         """
         Private slot to show a dialog with some bookmark info.
         """
-        from .BookmarkActionSelectionDialog import \
+        from .BookmarkActionSelectionDialog import (
             BookmarkActionSelectionDialog
+        )
         url = self.__browser.url()
         dlg = BookmarkActionSelectionDialog(url)
         if dlg.exec_() == QDialog.Accepted:
@@ -196,8 +196,9 @@
             if action == BookmarkActionSelectionDialog.AddBookmark:
                 self.__browser.addBookmark()
             elif action == BookmarkActionSelectionDialog.EditBookmark:
-                bookmark = self.__mw.bookmarksManager()\
-                    .bookmarkForUrl(url)
+                bookmark = (
+                    self.__mw.bookmarksManager().bookmarkForUrl(url)
+                )
                 from .BookmarkInfoDialog import BookmarkInfoDialog
                 dlg = BookmarkInfoDialog(bookmark, self.__browser)
                 dlg.exec_()
@@ -321,8 +322,10 @@
             return
         
         currentText = self.text().strip()
-        if evt.key() in [Qt.Key_Enter, Qt.Key_Return] and \
-           not currentText.lower().startswith("http://"):
+        if (
+            evt.key() in [Qt.Key_Enter, Qt.Key_Return] and
+            not currentText.lower().startswith(("http://", "https://"))
+        ):
             append = ""
             if evt.modifiers() == Qt.KeyboardModifiers(Qt.ControlModifier):
                 append = ".com"
@@ -403,7 +406,8 @@
         """
         threatInfo = self.__safeBrowsingLabel.getThreatInfo()
         if threatInfo:
-            from WebBrowser.SafeBrowsing.SafeBrowsingInfoWidget import \
+            from WebBrowser.SafeBrowsing.SafeBrowsingInfoWidget import (
                 SafeBrowsingInfoWidget
+            )
             widget = SafeBrowsingInfoWidget(threatInfo, self.__browser)
             widget.showAt(pos)

eric ide

mercurial