From f47d598ba9e8c504eb02cfd38dce907c7dff938f Mon Sep 17 00:00:00 2001 From: markm Date: Wed, 11 Mar 2009 01:57:18 +0000 Subject: [PATCH] * Final cleanup of the docs prior to release --- MANIFEST.in | 10 +++--- doc_src/HISTORY.TXT | 6 ++-- doc_src/contents.txt | 2 ++ doc_src/credits.txt | 2 ++ doc_src/index.txt | 72 +++++++++++++++++++++++--------------------- makedocs.bat | 2 +- setup.py | 19 ++++++------ 7 files changed, 62 insertions(+), 51 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index b2a647f..fe91889 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -22,8 +22,8 @@ exclude examples\examples_watsup\*.* # include all the website folder and make sure that # the sub version files are not included -include documentation\*.* -exclude documentation\.svn\* -exclude documentation\pywinauto\.svn\* -exclude documentation\pywinauto\controls\.svn\* -exclude documentation\pywinauto\tests\.svn\* +include docs\*.* +exclude docs\.svn\* +exclude docs\pywinauto\.svn\* +exclude docs\pywinauto\controls\.svn\* +exclude docs\pywinauto\tests\.svn\* diff --git a/doc_src/HISTORY.TXT b/doc_src/HISTORY.TXT index 0997cd4..ec62aa7 100644 --- a/doc_src/HISTORY.TXT +++ b/doc_src/HISTORY.TXT @@ -2,9 +2,11 @@ Change Log ========== -0.3.8 Various minor changes and fixes +0.3.8 Collecting improvements from last 2 years ------------------------------------------------------------------ -10-December-2008 +10-March-2009 + + * Converted documenation from Pudge generated to Sphinx Generated * Ensured that return value from ComboBoxWrapper.SelectedIndices is always a tuple (there was a bug where it would sometimes be diff --git a/doc_src/contents.txt b/doc_src/contents.txt index 4a5cdf6..b119c3e 100644 --- a/doc_src/contents.txt +++ b/doc_src/contents.txt @@ -2,6 +2,8 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. +.. _contents-root: + Contents ===================================== diff --git a/doc_src/credits.txt b/doc_src/credits.txt index 9205adb..ef07574 100644 --- a/doc_src/credits.txt +++ b/doc_src/credits.txt @@ -1,3 +1,5 @@ +Credits +------- Stefaan Himpe - Lots of speed and stability improvements early on Jeff Winkler - Early encouragement, creation of screencasts Dalius Dobravolskas - Help on the forums and prompted major improvements on the wait* functionality diff --git a/doc_src/index.txt b/doc_src/index.txt index 1d8cc9d..a20343b 100644 --- a/doc_src/index.txt +++ b/doc_src/index.txt @@ -5,6 +5,8 @@ What is pywinauto Released under the LGPL licence +:ref:`Full table of contents. ` + What is it? ----------- pywinauto is a set of python modules to automate the Microsoft Windows GUI. @@ -40,18 +42,18 @@ There are examples in there to work with Notepad and MSPaint. How does it work ---------------- -A lot is done through attribute access (__getattr__) for each class. For example +A lot is done through attribute access (``__getattr__``) for each class. For example when you get the attribute of an Application or Dialog object it looks for a dialog or control (respectively). :: myapp.Notepad # looks for a Window/Dialog of your app that has a title 'similar' - # to "Notepad" + # to "Notepad" myapp.PageSetup.OK # looks first for a dialog with a title like "PageSetup" - # then it looks for a control on that dialog with a title - # like "OK" + # then it looks for a control on that dialog with a title + # like "OK" This attribute resolution is delayed (currently a hard coded amount of time) until it succeeds. So for example if you Select a menu option and then look for the @@ -100,39 +102,41 @@ Why write yet another automation tool if there are so many out there? --------------------------------------------------------------------- There are loads of reasons :-) -*Takes a different approach* -Most other tools are not object oriented you end up writing stuff like:: +**Takes a different approach:** + Most other tools are not object oriented you end up writing stuff like:: - window = findwindow(title = "Untitled - Notepad", class = "Notepad") - SendKeys(window, "%OF") # Format -> Font - fontdialog = findwindow("title = "Font") - buttonClick(fontdialog, "OK") - -I was hoping to create something more userfriendly (and pythonic). For example -the translation of above would be:: - - win = app.UntitledNotepad - win.MenuSelect("Format->Font") - app.Font.OK.Click() + window = findwindow(title = "Untitled - Notepad", class = "Notepad") + SendKeys(window, "%OF") # Format -> Font + fontdialog = findwindow("title = "Font") + buttonClick(fontdialog, "OK") -*Python makes it easy* -Python is a great programming language, but I didn't find -any automation tools that were Pythonic (I only found one -that was implemented in python) and I didn't care for it -too much. + I was hoping to create something more userfriendly (and pythonic). For example + the translation of above would be:: -*Localization as a main requirement* -I work in the localization industry and GUI -automation is used extensively as often all -you need to do is ensure that your UI behaves -and is correct with respect to the Source -UI. This is actually an easier job then for -testing the original source UI. + win = app.UntitledNotepad + win.MenuSelect("Format->Font") + app.Font.OK.Click() -But most automation tools are based off of coordinates or text of the -controls and these can change in the localized software. So my goal ( -though not yet implemented) is to allow scripts to run unchanged -between original source language (often English) and the translated -software (Japanese, German, etc). + +**Python makes it easy:** + Python is a great programming language, but I didn't find + any automation tools that were Pythonic (I only found one + that was implemented in python) and I didn't care for it + too much. + + +**Localization as a main requirement:** + I work in the localization industry and GUI + automation is used extensively as often all + you need to do is ensure that your UI behaves + and is correct with respect to the Source + UI. This is actually an easier job then for + testing the original source UI. + + But most automation tools are based off of coordinates or text of the + controls and these can change in the localized software. So my goal ( + though not yet implemented) is to allow scripts to run unchanged + between original source language (often English) and the translated + software (Japanese, German, etc). \ No newline at end of file diff --git a/makedocs.bat b/makedocs.bat index 1c0c7ae..faf45cf 100644 --- a/makedocs.bat +++ b/makedocs.bat @@ -2,7 +2,7 @@ REM docs\build_autodoc_files.py -sphinx-build -b html docs docs\.build +sphinx-build -b html doc_build docs REM c:\.temp\pudge\pudge\cli --documents doc_source\index.rst,doc_source\controls_overview.rst,doc_source\howto.rst,doc_source\getting_started.rst,history.txt,license.txt,todo.txt --title pywinauto -v -d website -m pywinauto.application,pywinauto.taskbar,pywinauto.clipboard,pywinauto.timings,pywinauto.findbestmatch,pywinauto.findwindows,pywinauto.handleprops,pywinauto.XMLHelpers,pywinauto.controls,pywinauto.tests -t doc_source\template diff --git a/setup.py b/setup.py index cc768e2..1a622ca 100644 --- a/setup.py +++ b/setup.py @@ -46,16 +46,17 @@ def SetupPath(path = ""): # add it to the system path sys.path.append(SetupPath()) -# now it should be save to import pywinauto +# now it should be safe to import pywinauto import pywinauto # make sure the documentation is in the correct place for building -if "sdist" in sys.argv: - import shutil - if not os.path.exists(SetupPath("documentation")): - shutil.move(SetupPath("website"), SetupPath("documentation")) +# todo: see how to build the website +#if "sdist" in sys.argv: +# import shutil +# if not os.path.exists(SetupPath("docs")): +# shutil.move(SetupPath("website"), SetupPath("docs")) setup(name='pywinauto', @@ -91,10 +92,10 @@ controls also. ], ) - -if "sdist" in sys.argv: - if not os.path.exists(SetupPath("website")): - shutil.move(SetupPath("documentation"), SetupPath("website")) +# todo: see how to build the website later +#if "sdist" in sys.argv: +# if not os.path.exists(SetupPath("website")): +# shutil.move(SetupPath("documentation"), SetupPath("website")) try: