~ubuntu-branches/ubuntu/utopic/dogtail/utopic

« back to all changes in this revision

Viewing changes to examples/abiword-test.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-12-21 13:33:47 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20061221133347-xo9jg11afp5plcka
Tags: upstream-0.6.1
ImportĀ upstreamĀ versionĀ 0.6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
# Dogtail demo script
3
 
__author__ = 'David Malcolm <dmalcolm@redhat.com>'
4
 
 
5
 
# Test AbiWord, converting a Word document to HTML, using the procedural API.
6
 
# Also shows how to write code that handles different versions of a package,
7
 
# querying the installed package version in a distribution-neutral fashion.
8
 
# FIXME: not yet finished
9
 
# FIXME: doesn't work yet.  Tested with AbiWord 2.0.12 on FC3
10
 
 
11
 
from dogtail.procedural import *
12
 
from dogtail.utils import *
13
 
from dogtail.distro import *
14
 
from dogtail.version import Version
15
 
 
16
 
abiVersion = packageDb.getVersion('abiword')
17
 
 
18
 
# Set up appname based on version of abiword:
19
 
if abiVersion>=Version([2,3,0]):
20
 
        appName = 'AbiWord-2.4'
21
 
else:
22
 
        appName = 'AbiWord'
23
 
 
24
 
run("abiword", appName=appName)
25
 
 
26
 
 
27
 
print "foo"
28
 
 
29
 
focus.application(appName) #FIXME: shouldn't 'run' automatically scope the app?  this call seems to be needed
30
 
 
31
 
print "bar"
32
 
 
33
 
focus.menu('File')
34
 
click('Open...')
35
 
 
36
 
# On AbiWord 2.0.12 on FC3 this gives a GtkFileSelector dialog:
37
 
focus.dialog('Open File')  # fails on FC3: the dialog has roleName="file chooser", rather than 'dialog'
38
 
focus.text()
39
 
focus.widget.object.text = "test-word-document.doc"
40
 
# FIXME: path issues
41
 
 
42
 
click('OK')
43
 
 
44
 
focus.menu('File')
45
 
click('Save As...')