4 new revisions:

Revision: 41ed45926933
Branch:   default
Author:   Pekka Klärck
Date:     Mon Jun 10 23:07:27 2013
Log:      dialogs_py: reorg methods
http://code.google.com/p/robotframework/source/detail?r=41ed45926933

Revision: 611fa4834ca0
Branch:   default
Author:   Pekka Klärck
Date:     Mon Jun 10 23:21:49 2013
Log:      dialogs_py: Fixed closing the dialog on Linux....
http://code.google.com/p/robotframework/source/detail?r=611fa4834ca0

Revision: 69becc1aa6b0
Branch:   default
Author:   Pekka Klärck
Date:     Mon Jun 10 23:25:58 2013
Log:      Dialogs: little cleanup to code and tests.
http://code.google.com/p/robotframework/source/detail?r=69becc1aa6b0

Revision: 6cd0ad1a9020
Branch:   default
Author:   Pekka Klärck
Date:     Mon Jun 10 23:41:28 2013
Log:      Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=6cd0ad1a9020

==============================================================================
Revision: 41ed45926933
Branch:   default
Author:   Pekka Klärck
Date:     Mon Jun 10 23:07:27 2013
Log:      dialogs_py: reorg methods
http://code.google.com/p/robotframework/source/detail?r=41ed45926933

Modified:
 /src/robot/libraries/dialogs_py.py

=======================================
--- /src/robot/libraries/dialogs_py.py  Thu Jun  6 07:00:44 2013
+++ /src/robot/libraries/dialogs_py.py  Mon Jun 10 23:07:27 2013
@@ -25,15 +25,11 @@
     def __init__(self, message, value=None):
         self._prevent_execution_with_timeouts()
         Toplevel.__init__(self, self._get_parent())
-        self._init_dialog()
+        self._initialize_dialog()
         self._create_body(message, value)
         self._create_buttons()
         self._result = None

-    def show(self):
-        self.wait_window(self)
-        return self._result
-
     def _prevent_execution_with_timeouts(self):
         if 'linux' not in sys.platform \
                 and currentThread().getName() != 'MainThread':
@@ -45,7 +41,7 @@
         parent.withdraw()
         return parent

-    def _init_dialog(self):
+    def _initialize_dialog(self):
         self.title('Robot Framework')
         self.grab_set()
         self.protocol("WM_DELETE_WINDOW", self._right_button_clicked)
@@ -93,12 +89,12 @@
             self._result = self._get_value()
             self.destroy()

-    def _get_value(self):
-        return None
-
     def _validate_value(self):
         return True

+    def _get_value(self):
+        return None
+
     def _right_button_clicked(self, event=None):
         self._result = self._get_right_button_value()
         self.destroy()
@@ -106,6 +102,10 @@
     def _get_right_button_value(self):
         return None

+    def show(self):
+        self.wait_window(self)
+        return self._result
+

 class MessageDialog(_TkDialog):
     _right_button = None

==============================================================================
Revision: 611fa4834ca0
Branch:   default
Author:   Pekka Klärck
Date:     Mon Jun 10 23:21:49 2013
Log:      dialogs_py: Fixed closing the dialog on Linux.

Update issue 1466
Status: Review
Fixed the problem by keeping a reference to the parent and destroying it.

Tested that the solution fixes the problem on Linux and doesn't cause issues on Windows 7.
Still needs to be tested on OSX before closing.
http://code.google.com/p/robotframework/source/detail?r=611fa4834ca0

Modified:
 /atest/robot/standard_libraries/dialogs/dialogs.txt
 /atest/testdata/standard_libraries/dialogs/dialogs.txt
 /src/robot/libraries/dialogs_py.py

=======================================
--- /atest/robot/standard_libraries/dialogs/dialogs.txt Fri Sep 28 00:42:50 2012 +++ /atest/robot/standard_libraries/dialogs/dialogs.txt Mon Jun 10 23:21:49 2013
@@ -33,6 +33,9 @@

 Get Selection From User Cancelled
     Check Test Case  ${TESTNAME}
+
+Multiple dialogs in a row
+    Check Test Case  ${TESTNAME}

 Dialog and timeout
     [Tags]    regression  jybot  manual
=======================================
--- /atest/testdata/standard_libraries/dialogs/dialogs.txt Mon Apr 29 03:54:56 2013 +++ /atest/testdata/standard_libraries/dialogs/dialogs.txt Mon Jun 10 23:21:49 2013
@@ -43,6 +43,13 @@
     [Documentation]  FAIL No value provided by user
     Get Selection From User    Press Cancel.    zip    zap    foo

+Multiple dialogs in a row
+    [Documentation]  FAIL No value provided by user
+ Pause Execution Verify that dialog is closed immediately.\n\nAfter pressing Ok.
+    Sleep    1s
+ Get Value From User Verify that dialog is closed immediately.\n\nAfter pressing Cancel.
+    [Teardown]    Sleep    1s
+
 Dialog and timeout
     [Timeout]  1s
     [Tags]     jybot_only
=======================================
--- /src/robot/libraries/dialogs_py.py  Mon Jun 10 23:07:27 2013
+++ /src/robot/libraries/dialogs_py.py  Mon Jun 10 23:21:49 2013
@@ -24,7 +24,8 @@

     def __init__(self, message, value=None):
         self._prevent_execution_with_timeouts()
-        Toplevel.__init__(self, self._get_parent())
+        self._parent = self._get_parent()
+        Toplevel.__init__(self, self._parent)
         self._initialize_dialog()
         self._create_body(message, value)
         self._create_buttons()
@@ -87,7 +88,7 @@
     def _left_button_clicked(self, event=None):
         if self._validate_value():
             self._result = self._get_value()
-            self.destroy()
+            self._close()

     def _validate_value(self):
         return True
@@ -95,9 +96,13 @@
     def _get_value(self):
         return None

+    def _close(self):
+        # self.destroy() is not enough on Linux
+        self._parent.destroy()
+
     def _right_button_clicked(self, event=None):
         self._result = self._get_right_button_value()
-        self.destroy()
+        self._close()

     def _get_right_button_value(self):
         return None

==============================================================================
Revision: 69becc1aa6b0
Branch:   default
Author:   Pekka Klärck
Date:     Mon Jun 10 23:25:58 2013
Log:      Dialogs: little cleanup to code and tests.
http://code.google.com/p/robotframework/source/detail?r=69becc1aa6b0

Modified:
 /atest/robot/standard_libraries/dialogs/dialogs.txt
 /atest/testdata/standard_libraries/dialogs/dialogs.txt
 /src/robot/libraries/Dialogs.py

=======================================
--- /atest/robot/standard_libraries/dialogs/dialogs.txt Mon Jun 10 23:21:49 2013 +++ /atest/robot/standard_libraries/dialogs/dialogs.txt Mon Jun 10 23:25:58 2013
@@ -1,6 +1,7 @@
 *** Settings ***
Suite Setup Run Tests --exclude jybot_only standard_libraries/dialogs/dialogs.txt
-Default Tags      regression  jybot  pybot  manual
+Force Tags      regression  manual
+Default Tags    jybot  pybot
 Resource        atest_resource.txt

 *** Test Cases ***
@@ -38,6 +39,6 @@
     Check Test Case  ${TESTNAME}

 Dialog and timeout
-    [Tags]    regression  jybot  manual
+    [Tags]    jybot
     Run Tests  --include jybot_only  standard_libraries/dialogs/dialogs.txt
     Check Test Case  ${TESTNAME}  FAIL  Test timeout 1 second exceeded.
=======================================
--- /atest/testdata/standard_libraries/dialogs/dialogs.txt Mon Jun 10 23:21:49 2013 +++ /atest/testdata/standard_libraries/dialogs/dialogs.txt Mon Jun 10 23:25:58 2013
@@ -31,7 +31,7 @@
     Should Be Equal    ${value}    ${EMPTY}

 Get Value From User Cancelled
-    [Documentation]  FAIL No value provided by user
+    [Documentation]  FAIL No value provided by user.
     Get Value From User    Press Cancel.

 Get Selection From User
@@ -40,11 +40,11 @@
     Should Be Equal    ${value}    value

 Get Selection From User Cancelled
-    [Documentation]  FAIL No value provided by user
+    [Documentation]  FAIL No value provided by user.
     Get Selection From User    Press Cancel.    zip    zap    foo

 Multiple dialogs in a row
-    [Documentation]  FAIL No value provided by user
+    [Documentation]  FAIL No value provided by user.
Pause Execution Verify that dialog is closed immediately.\n\nAfter pressing Ok.
     Sleep    1s
Get Value From User Verify that dialog is closed immediately.\n\nAfter pressing Cancel.
=======================================
--- /src/robot/libraries/Dialogs.py     Thu Jun  6 07:00:44 2013
+++ /src/robot/libraries/Dialogs.py     Mon Jun 10 23:25:58 2013
@@ -80,9 +80,8 @@
     fails the keyword.

     Example:
-    | Do something | | | |
- | ${value} = | Get Value From User | Enter new value | default_value=1 |
-    | Do something with the value | ${value} | | |
+ | ${value} = | Get Value From User | Enter new value | default_value=1 |
+    | Do something | ${value} |
     """
     return _validate_user_input(InputDialog(message, default_value))

@@ -99,5 +98,5 @@
 def _validate_user_input(dialog):
     value = dialog.show()
     if value is None:
-        raise RuntimeError('No value provided by user')
+        raise RuntimeError('No value provided by user.')
     return value

==============================================================================
Revision: 6cd0ad1a9020
Branch:   default
Author:   Pekka Klärck
Date:     Mon Jun 10 23:41:28 2013
Log:      Automated merge with https://code.google.com/p/robotframework/
http://code.google.com/p/robotframework/source/detail?r=6cd0ad1a9020


--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to robotframework-commit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to