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

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 04 Feb 2018 10:56:30 +0100
branch
maintenance
changeset 6114
0c976706e8c1
parent 6104
21da0d78cad4
child 6166
bace7fb85a01

Fixed an issue related to the use of sender() method.
(grafted from 0cf5c9683a512c0c8f376d558796daf14b081d68)

Helpviewer/PersonalInformationManager/PersonalInformationManager.py file | annotate | diff | comparison | revisions
WebBrowser/PersonalInformationManager/PersonalInformationManager.py file | annotate | diff | comparison | revisions
--- a/Helpviewer/PersonalInformationManager/PersonalInformationManager.py	Sat Feb 03 10:48:45 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	Sat Feb 03 10:48:45 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