Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Packages/vcs/Lib/VTKPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@ def setAnimationStepper( self, stepper ):
plot.setAnimationStepper( stepper )

def interact(self,*args,**kargs):
warnings.warn("Press 'Q' to exit interactive mode and continue script execution")
if self.renWin is None:
warnings.warn("Cannot interact if you did not open the canvas yet")
return
interactor = self.renWin.GetInteractor()
if interactor is None:
warnings.warn("Cannot start interaction. Blank plot?")
return
warnings.warn("Press 'Q' to exit interactive mode and continue script execution")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning seems un-necessary here. I would just document it. Probably create a --help option on the vcs scripts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually had thankful comments about the "Q" warning so I think we should leave this one in.
Not many people read the documentation, especially people that used vcs before
I'm willing to remove the warning for blank screens.
we can't implement a --help in this case, it's part of the vcs module not a script.
@jypeter I would love to hear what you have to say about this.

interactor.Start()

def leftButtonPressEvent(self,obj,event):
Expand Down
8 changes: 8 additions & 0 deletions testing/vcs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ add_test(vcs_test_clear_empy_canvas
${CMAKE_INSTALL_PREFIX}/bin/python
${cdat_SOURCE_DIR}/testing/vcs/test_clear_empty_canvas.py
)
add_test(vcs_test_interact_no_open
${CMAKE_INSTALL_PREFIX}/bin/python
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_interact_no_open.py
)
add_test(vcs_test_interact_no_plot
${CMAKE_INSTALL_PREFIX}/bin/python
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_interact_no_plot.py
)

add_test(vcs_test_colorcells
${CMAKE_INSTALL_PREFIX}/bin/python
Expand Down
3 changes: 3 additions & 0 deletions testing/vcs/test_vcs_interact_no_open.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import vcs
x=vcs.init()
x.interact()
4 changes: 4 additions & 0 deletions testing/vcs/test_vcs_interact_no_plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import vcs
x=vcs.init()
x.open()
x.interact()