~ubuntu-bugcontrol/ubuntu-qa-tools/ldtp-tools

« back to all changes in this revision

Viewing changes to ldtp-tools/get_all_children.py

  • Committer: Ara
  • Date: 2009-03-12 18:08:49 UTC
  • Revision ID: ara@sushirider-20090312180849-8poq5h6yb6vslabr
Added new script get_all_children.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
from ldtp import *
 
4
from ooldtp import *
 
5
 
 
6
from optparse import OptionParser
 
7
 
 
8
#Defining the command line arguments
 
9
usage = '%prog window_name output_file'
 
10
parser = OptionParser(usage)
 
11
(options, args) = parser.parse_args ()
 
12
 
 
13
if len (args) != 2:
 
14
    parser.error ('Incorrect number of arguments')
 
15
 
 
16
app = context(args[0])
 
17
output = open(args[1], "w")
 
18
 
 
19
for component in app.getobjectlist():
 
20
    role = getobjectproperty(args[0], component, 'class')
 
21
    output.write(component + ", " + role + "\n")
 
22
 
 
23
output.flush()
 
24
ouput.close()
 
25
 
 
26
 
 
27