1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
|
Description: Modify examples so that they do not run forever
When invoked in script mode (-c) pymol up until v2 used to exit; newer
versions will loop the aninamtion forever. This patch puts an explicit
stop at the end of each script where there is an animation being generated
to make it stop playing.
.
While this potentially makes the examples less useful to run from the
command line themselves without editing, it at least fixes the tests.
Author: Stuart Prescott <stuart@debian.org>
Bug: #897191
--- a/examples/cookbook/area_diff.pml
+++ b/examples/cookbook/area_diff.pml
@@ -69,4 +69,5 @@
mplay
+mstop
--- a/examples/cookbook/scenes2movie.pml
+++ b/examples/cookbook/scenes2movie.pml
@@ -59,3 +59,4 @@
rewind
mplay
+mstop
--- a/examples/devel/cgo_label_hack.py
+++ b/examples/devel/cgo_label_hack.py
@@ -1,5 +1,6 @@
import string
import math
+import time
from pymol.cgo import *
from pymol import cmd
@@ -65,3 +66,6 @@
cmd.mplay()
+time.sleep(3)
+
+cmd.mstop()
--- a/examples/devel/cgo02.py
+++ b/examples/devel/cgo02.py
@@ -1,6 +1,7 @@
from pymol.cgo import *
from pymol import cmd
import math
+import time
# this is an example of creating a cgo object consisting of multiple
# states which form a movie
@@ -47,4 +48,6 @@
cmd.mplay()
-
+time.sleep(3)
+
+cmd.mstop()
--- a/examples/devel/cgo03.py
+++ b/examples/devel/cgo03.py
@@ -1,6 +1,7 @@
from pymol.cgo import *
from pymol import cmd
import math
+import time
# a more comple example of using cgo's to create a fancy animation.
@@ -84,4 +85,6 @@
cmd.mplay()
-
+time.sleep(3)
+
+cmd.mstop()
--- a/examples/devel/webgui02.py
+++ b/examples/devel/webgui02.py
@@ -8,6 +8,7 @@
import time
import cgi
+import string
import threading
import traceback
import os, sys, re
--- a/examples/devel/scenes_to_movie01.pml
+++ b/examples/devel/scenes_to_movie01.pml
@@ -73,5 +73,5 @@
mplay
-
+mstop
--- a/examples/devel/chempy_model03.py
+++ b/examples/devel/chempy_model03.py
@@ -7,12 +7,7 @@
# first we need a model
-if os.path.exists("$PYMOL_PATH/test/dat/pept.pdb"):
- cmd.load("$PYMOL_PATH/test/dat/pept.pdb","demo")
-else:
- from inspect import getsourcefile
- current_file_dir = os.path.dirname(os.path.abspath(getsourcefile(lambda:0)))
- cmd.load(os.path.join(current_file_dir, "../../test/dat/pept.pdb"), "demo")
+cmd.load("$PYMOL_PATH/test/dat/pept.pdb","demo")
# let's dress it up a little bit
@@ -43,3 +38,7 @@
# by default, PyMOL plays ~30 fps.
# "set movie_delay=0" to see maximum speed...
+
+time.sleep(3)
+
+cmd.mstop()
--- a/examples/devel/gl03.py
+++ b/examples/devel/gl03.py
@@ -5,6 +5,7 @@
'''
import numpy
+import time
from OpenGL.GL import *
from pymol.callback import Callback
from pymol import cmd
@@ -105,3 +106,6 @@
cmd.mset('1-62')
cmd.mplay()
+time.sleep(3)
+
+cmd.mstop()
--- a/data/demo/cgo03.py
+++ b/data/demo/cgo03.py
@@ -1,6 +1,7 @@
from pymol.cgo import *
from pymol import cmd
import math
+import time
# a more comple example of using cgo's to create a fancy animation.
@@ -84,4 +85,6 @@
cmd.mplay()
-
+time.sleep(3)
+
+cmd.mstop()
--- a/examples/devel/mutate02.py
+++ b/examples/devel/mutate02.py
@@ -1,5 +1,7 @@
# This example mutates every residue of a chain to alanine.
+import string
+
# load a structure
cmd.load("$TUT/1hpv.pdb")
|