Skip to content

Commit 6acf8e3

Browse files
committed
MNT: single call to runJavaScript('tourxml;')
1 parent 7783e4a commit 6acf8e3

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

glue_wwt/viewer/tools.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,11 @@ def activate(self):
8888

8989
self.viewer._wwt.widget.page.runJavaScript(SAVE_TOUR_CODE)
9090

91-
start = time.time()
9291
tourxml = None
93-
while time.time() - start < 10:
94-
time.sleep(0.1)
95-
app.processEvents()
96-
tourxml = self.viewer._wwt.widget.page.runJavaScript('tourxml;')
97-
if tourxml:
98-
break
92+
time.sleep(1)
93+
app.processEvents()
94+
time.sleep(1)
95+
tourxml = self.viewer._wwt.widget.page.runJavaScript('tourxml;')
9996

10097
if not tourxml:
10198
raise Exception("Failed to save tour")

0 commit comments

Comments
 (0)