loops/agent/crawl/watsup/tools/findAppControls.py
tschmid 41e98f0bef initial check in
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2069 fd906abe-77d9-0310-91a1-e0d9ade77398
2007-09-25 06:31:14 +00:00

42 lines
1.1 KiB
Python

""" Lists the windowText and className for a given executable on the system.
Usage:
c:>findAppControls.py example/example1
c:>findAppControls.py -v example/example1
- this does it in verbose mode
"""
# Author : Tim Couper - tim@tizmoi.net
# Date : 1 August 2004
# Copyright : Copyright TAC Software Ltd, under Python-like licence.
# Provided as-is, with no warranty.
# Notes : Requires watsup
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-v", "--verbose",
action="store_true", dest="verbose", default=False,
help="print verbose messages")
(options, args) = parser.parse_args()
if len(args)<1:
print 'Usage: findAppControls.py <path_to_executable>'
else:
from watsup.AppControls import AppControls
try:
print 'passing',args[0]
a=AppControls(args[0],verbose=options.verbose)
a.run()
except:
import sys
print '\n** %s **\n' % sys.exc_info()[1]
import traceback
traceback.print_tb(sys.exc_info()[2])