summaryrefslogtreecommitdiffstats
path: root/dcoppython/test/automate_presentation.py
blob: a1833d2e733c7a2a73d8c7407b0cf54818fe21f5 (plain)
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
# Python version of David Faure's <faure@kde.org> dcop presentation automation script for kpresenter
#
# Simon Hausmann <hausmann@kde.org>
from time import sleep
import pcop
import pydcop

app = pydcop.anyAppCalled( "kpresenter" )

if not app: raise RuntimeError("Couldn't find a running KPresenter")

doc = app.KoApplicationIface.getDocuments()[0]
view = doc.view(0)

startAction = view.action( "screen_start" )

print("Starting Presentation %s" % doc.url())

startAction.activate()

sleep( 5 )

act = view.action( "screen_next" )
while startAction.enabled() == 0:
	sleep( 10 )
	if startAction.enabled() == 0:
	  act.activate()
	
view.screenStop()
print("Presentation finished.")