pyWinAuto: c:\.projects\py_pywinauto\pywinauto\controls\__init__.py

0001# GUI Application automation and testing library
0002# Copyright (C) 2006 Mark Mc Mahon
0003#
0004# This library is free software; you can redistribute it and/or
0005# modify it under the terms of the GNU Lesser General Public License
0006# as published by the Free Software Foundation; either version 2.1
0007# of the License, or (at your option) any later version.
0008#
0009# This library is distributed in the hope that it will be useful,
0010# but WITHOUT ANY WARRANTY; without even the implied warranty of
0011# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0012# See the GNU Lesser General Public License for more details.
0013#
0014# You should have received a copy of the GNU Lesser General Public
0015# License along with this library; if not, write to the
0016#    Free Software Foundation, Inc.,
0017#    59 Temple Place,
0018#    Suite 330,
0019#    Boston, MA 02111-1307 USA
0020
0021"Controls package"
0022
0023__revision__ = "$Revision: 543 $"
0024
0025from HwndWrapper import GetDialogPropsFromHandle
0026
0027# make an alias for the HwndWrapper object as WrapHandle
0028from HwndWrapper import HwndWrapper as WrapHandle
0029
0030# import the control clases - this will register the classes they
0031# contain
0032import common_controls
0033import win32_controls
0034
0035#
0036##====================================================================
0037#def _unittests():
0038#    "Run some tests on the controls"
0039#    from pywinauto import win32functions
0040#
0041#    "do some basic testing"
0042#    from pywinauto.findwindows import find_windows
0043#    import sys
0044#
0045#    if len(sys.argv) < 2:
0046#        handle = win32functions.GetDesktopWindow()
0047#    else:
0048#        try:
0049#            handle = int(eval(sys.argv[1]))
0050#
0051#        except ValueError:
0052#
0053#            handle = find_windows(
0054#                title_re = "^" + sys.argv[1], class_name = "#32770", )
0055#                #visible_only = False)
0056#
0057#            if not handle:
0058#                print "dialog not found"
0059#                sys.exit()
0060#
0061#
0062#    props = GetDialogPropsFromHandle(handle)
0063#    print len(props)
0064#    #pprint(GetDialogPropsFromHandle(handle))
0065#
0066#if __name__ == "__main__":
0067#    _unittests()