Fixed an issue related to the use of sender() method.

Sun, 04 Feb 2018 10:56:30 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 04 Feb 2018 10:56:30 +0100
changeset 6113
0cf5c9683a51
parent 6112
cc1fc199643b
child 6115
ac3a98f3ebc2

Fixed an issue related to the use of sender() method.

Helpviewer/PersonalInformationManager/PersonalInformationManager.py file | annotate | diff | comparison | revisions
WebBrowser/PersonalInformationManager/PersonalInformationManager.py file | annotate | diff | comparison | revisions
--- a/Helpviewer/PersonalInformationManager/PersonalInformationManager.py	Sun Feb 04 10:45:53 2018 +0100
+++ b/Helpviewer/PersonalInformationManager/PersonalInformationManager.py	Sun Feb 04 10:56:30 2018 +0100
@@ -224,15 +224,17 @@
         
         @param page reference to the web page (HelpWebPage)
         """
-        page.loadFinished.connect(self.__pageLoadFinished)
+        page.loadFinished.connect(lambda ok: self.__pageLoadFinished(ok, page))
     
-    def __pageLoadFinished(self, ok):
+    def __pageLoadFinished(self, ok, page):
         """
         Private slot to handle the completion of a page load.
         
-        @param ok flag indicating a successful load (boolean)
+        @param ok flag indicating a successful load
+        @type bool
+        @param page reference to the web page object
+        @type HelpWebPage
         """
-        page = self.sender()
         if page is None or not ok:
             return
         
--- a/WebBrowser/PersonalInformationManager/PersonalInformationManager.py	Sun Feb 04 10:45:53 2018 +0100
+++ b/WebBrowser/PersonalInformationManager/PersonalInformationManager.py	Sun Feb 04 10:56:30 2018 +0100
@@ -231,17 +231,20 @@
         Public method to allow the personal information manager to connect to
         the page.
         
-        @param page reference to the web page (HelpWebPage)
+        @param page reference to the web page
+        @type WebBrowserPage
         """
-        page.loadFinished.connect(self.__pageLoadFinished)
+        page.loadFinished.connect(lambda ok:self.__pageLoadFinished(ok, page))
     
-    def __pageLoadFinished(self, ok):
+    def __pageLoadFinished(self, ok, page):
         """
         Private slot to handle the completion of a page load.
         
-        @param ok flag indicating a successful load (boolean)
+        @param ok flag indicating a successful load
+        @type bool
+        @param page reference to the web page object
+        @type WebBrowserPage
         """
-        page = self.sender()
         if page is None or not ok:
             return
         

eric ide

mercurial