Awesome! I don't have any Windows machines at home but I could try to
do some very simple test tomorrow when I get to the office.
> Oh, and any comments are welcome. I know there are some pieces missing
> (called out as TODO in the code) and there's some stuff I need to clean up,
> but it's a first look at what I'm doing.
At least you might consider doing something like below so that you
don't need to check are self.app and self.dlg None in every method:
class winbot:
def __init__(self):
self._app = None
self._dlg = None
def ._get_app(self):
if not self._app:
raise RuntimeError('No application open')
return self._app
def ._get_dlg(self):
if not self._dlg:
raise RuntimeError('No dialog open')
return self._dlg
app = property(_get_app)
dlg = property(_get_dlg)
Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
Unfortunately I didn't have time to look at this while at office. Has
anyone else here tried this? Sending a note to the users list would
probably raise more interest as there are more people.
Have you planned starting a project around this library? That would be awesome!
Anyone wanna test this for me? I checked it out a bit, but running out of time today, and wanted to get it out there for others to look at.
It's a PyWinAuto library that automates a windows GUI. You'll need pywinauto and it's dependancies installed, and of course it only runs on windows (not linux/mac/solaris/et.c)
Oh, and any comments are welcome. I know there are some pieces missing (called out as TODO in the code) and there's some stuff I need to clean up, but it's a first look at what I'm doing.
ElementTree and ctypes are both in the standard library starting from
Python 2.5. That release is over three years old so most systems
already have either that or Python 2.6. SendKeys is only one or two
files and has such a license that it's possible to just include it
into the library.
Cheers,
.peke
Sounds great!
> Anywhere I should put this, special way I should package it, etc.? What's
> the process to submit a library to RF? And how should i do the example? You
> just want it in a single file? Any format you'd like? I figured I'd just do
> notepad...
It's easiest if you simply start a new project for this purpose - no
need to ask permissions for that! We've been pretty happy with Google
Code hosting but if you prefer GitHub, SourceForge, or something else
that's fine too. Similarly you can pick the license freely (unless you
use GPL code directly in which case you must use GPL too) but I'd
recommend Apache 2. You are free to use 'robotframework-' prefix in
the project name but obviously not obliged to. You can also use
rf-users and rf-devel mailin lists for communication if you want but
you might want to create a separate commit mailing list. When you got
the project set up, we can link it from the main RF site and you
should also announce it on rf-users mailing list latest then.
This all may sound like a lot of work but shouldn't take more than
half an hour. If you need any help or have more questions just ask!
You might also want to take a look at great, and free, book Producing
Open Source Software (http://producingoss.com) for more information
related to running an open source project.
> Also, is there a program to document the keywords based on docstrings, or is
> that a manual process?
Yes there is: http://code.google.com/p/robotframework/wiki/LibraryDocumentationTool
My questions were mainly oriented towards "how do I work towards
getting this into RF mainline?". I realize I'll have to setup a
seperate project at first, but wondered if there was a preferred way
of packaging, or documenting, or if there's a set way of going about
this to increase chances/ease of integration into mainline, or even if
that is an option for this module.
Thanks for the info btw!
- Tim
Cool! Then the book may not give that much new information but at
least you can refer others to it later.
> My questions were mainly oriented towards "how do I work towards getting
> this into RF mainline?". I realize I'll have to setup a seperate project at
> first, but wondered if there was a preferred way of packaging, or
> documenting, or if there's a set way of going about this to increase
> chances/ease of integration into mainline, or even if that is an option for
> this module.
I actually think it's better to keep libraries like this as separate
projects. We don't have any plans for integrating e.g. SeleniumLibrary
or SwingLibrary projects more closely with the core either. There are
some standard libraries that are distributed automatically with the
core framework, but they generally work on all platforms and don't
require any additional dependencies. External libraries can also have
their own release schedules and, as I wrote earlier, different
licenses, copyrights, etc. than the core framework.
External libs can obviously also handle packaging, documentation, etc.
using tools that suite their needs. We've normally used Python's
standard distutils module for packaging Python code and created
separate source distributions and Windows installers. Java libraries
(e.g. SwingLibrary) are typically packaged using JAR archives. For
documentation we tend to use the earlier mentioned libdoc.py tool.
Great!
> I won't announce it on the user side until I have more documentation
> and such, but it's out there. Let's wait to put anything on the user's
> list until I've added at the least an example and the library
> documentation.
Sure. As the author you, of course, have the privilege to send the announcement.
> Oh, and for my packaging I'm using setuptools. It handles the sendkeys
> and pywinauto dependancies for me, so I don't need to package those
> along with it.
Sounds good.